1.使用文件创建用户名和密码
文件创建在用户主目录下:
touch .git-credentials
vim .git-credentials
https://{username}:{password}@github.com
记得在真正输入的时候是没有大括号的。
- 添加
git config
内容
git config --global credential.helper store
执行此命令后,用户主目录下的.gitconfig
文件会多了一项:[credential]
helper = store
重新git push
就不需要用户名密码了。
本文由 giao创作, 采用 知识共享署名4.0 国际许可协议进行许可 本站文章除注明转载/出处外,均为本站原创或翻译,转载前请务必署名 原文地址:《git push 免密码》
最后一次更新于2019-08-11
0 条评论