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

Posted Basu

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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就不需要密码啦!

以上是关于git在用https进行push时候免输账密的方法的主要内容,如果未能解决你的问题,请参考以下文章