先新建一个文件
$ touch ~/.git-credentials
???$ vim ~/.git-credentials
进去添加内容(github为github.com,码云为gitee.com)
???https://{username}:{passwd}@gitee.com
然后再添加git配置
???$ git config --global credential.helper store
可以查看~/.gitconfig文件的变化
???[credential]
???????helper = store
此时再push就不需要密码啦!
git在用https进行push时候免输账密的方法
原文地址:http://www.cnblogs.com/Basu/p/7853754.html