创建文件存储GIT用户名和密码
打开git bash客户端,进入%HOME%目录(一般为C:usersyourUserName),执行以下命令,注意要带上大括号
>>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