Meth | Git 避免重复输入用户名和密码方法

git config --global credential.helper store

1.2 添加Git Config 内容

进入git bash终端, 输入如下命令:

git config --global credential.helper store

执行完后查看%HOME%目录下的.gitconfig文件,会多了一项:

[credential]

    helper = store

重新开启git bash会发现git push时不用再输入用户名和密码

说明:经测试,可以直接进行第二步,在git中对远程进行访问时会提示输入一次用户名与密码,此时会默认在相应路径下(%HOME%)创建.git-credentials文件,内容为类似https://{username}:{password}@github.com的文本。以后便不会再要求提示啦。

猜你喜欢

转载自www.cnblogs.com/PlusHappy/p/9909060.html