在 Windows系统中,首先查看是否有文件 .git-credentials
可以用 everything 软件搜索,如果没有则按如下操作配置:
打开 git bash 命令行界面,运行下面两条指令
echo '[credential]' >> .git/config
echo ' helper = store' >> .git/config
这时查看一下git的 config 配置文件如下
接着我们在 git bash 命令行窗口中执行命令 git pull 或者 git push,然后会弹出输入账号和密码框,可能有两次,两次都正确输入后,这时会自动新建
.git-credentials
这样下次就不用再正确输入账号和密码了,即使要输入随便输入也行。
参考页面:
https://cloud.tencent.com/developer/article/1472737