Linux下执行 git push, pull 等操作免除输入账号、密码

操作步骤:

进入到根目录: 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 
版权声明:本文为博主原创文章,转载请附上博文链接!

发布了24 篇原创文章 · 获赞 4 · 访问量 1万+

猜你喜欢

转载自blog.csdn.net/qq_34343254/article/details/92812296