1.在~下,创建文件 .git-credentials, 用gedit编辑此文件:

1
2
3
suda@suda-Aspire-4750:~$cd
suda@suda-Aspire-4750:~$touch .git-credentials
suda@suda-Aspire-4750:~$gedit .git-credentials

然后输入:https://{username}:{password}@github.com
例如:https://aoeddklj:1233ds@github.com
2.在终端下执行

1
suda@suda-Aspire-4750:~$git config --global credential.helper store

3.查看~/.gitconfig是否会多了一项:

1
2
[credential]
helper = store

如果存在,就不需要输入密码了

参考:http://weibo.com/p/1001603737697985379267?from=page_100505_profile&wvr=6&mod=wenzhangmod