操作步骤:
进入到根目录: cd ~
创建文件 .git-credentials: touch .git-credentials
编辑 .git-credentials : vim .git-credentials
输入如下内容:
https://githup账号:密码@github.com
// 例如: https://tianzez:[email protected]
1
2
保存退出vim编辑, 执行: git config --global credential.helper store
查看 ~/.gitconfig 文件, 里面多出如下内容:
[credential]
helper = store
1
2
执行一下 git push 等需要输入账号密码的操作, 可能第一次还需要输入账号密码, 但这次输入完后, 以后再进行这些操作就不用输入账号和密码了.
---------------------
作者:Tianzez
来源:CSDN
原文:https://blog.csdn.net/tianzez/article/details/86650430
版权声明:本文为博主原创文章,转载请附上博文链接!