git for windows 总是提示输入用户名和秘密

建议提前升级git到最新版本

删除.gitconfig,重新执行以下操作


创建文件存储GIT用户名和密码
打开git bash客户端,进入%HOME%目录(一般为C:\users\yourUserName\),执行以下命令,注意要带上大括号
>>touch .git-credentials
>>vim .git-credentials
https://{username}:{password}@github.com

添加Git Config 内容
进入git bash终端, 输入如下命令:
git config --global credential.helper store

执行完后查看%HOME%目录下的.gitconfig文件,会多了一项
[credential]
    helper = store


重新开启git bash会发现git push时不用再输入用户名和密码


原文 http://www.cnblogs.com/ballwql/p/3462104.html

你可能感兴趣的:(SourceTree)