欢迎您访问 最编程 本站为您分享编程语言代码,编程技术文章!
您现在的位置是: 首页

解决 github 为每次 pull push 输入密码的问题

最编程 2024-10-13 17:09:56
...

# 解决git pull/push每次都需要输入密码问题
git bash进入你的项目目录,输入:

git config --global credential.helper store

然后你会在你本地生成一个文本,上边记录你的账号和密码。配置项写入到 "C:\Users\用户名\ .gitconfig" 文件中。
然后你使用上述的命令配置好之后,再操作一次git pull,然后它会提示你输入账号密码,这一次之后就不需要再次输入密码了。
此外,相关操作
git config credential.helper 记住保存账号密码、关闭取消密码自动存储

取消(删除)记录账号和密码

git config --global --unset credential.helper

查询 凭证存储模式

git config --global credential.helper
或
git config --global --list
或
git config --global -l

修改 配置文件

git config --file=~/.git_credentails --global credential.helper "store"git config --global  user.name "store"

推荐阅读