git在用https进行push时候免输账密的方法

先新建一个文件

$ 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就不需要密码啦!

posted @ 2017-11-17 22:09  Basu  阅读(532)  评论(0编辑  收藏  举报