1、创建文件,进入文件,输入内容:
cd ~
touch .git-credentials
vim .git-credentials
https://{username}:{password}@github.com
2、在终端下输入:
git config --global credential.helper store
打开~/.gitconfig文件,会发现多了一项:
[credential]
helper = store
其实直接执行“git config --global credential.helper store”,然后调用一次“git push xxx”操作,输入一次账户和密码之后,git就会自动生成一个.git-credentials文件,然后将本次的账号密码信息保存进文件中。
原文链接:https://blog.csdn.net/tq384998430/article/details/77770127