当前位置:   article > 正文

git pull 时每次都要输入用户名和密码的解决办法_git pull需要输入用户密码

git pull需要输入用户密码

环境:Ubuntu18.0.4(windows的在下面)

git clone的下载代码的时候用https://而不是git@git (ssh)的形式,当我们操作git pull/push到远程的时候,总是提示我们输入账号和密码才能操作成功,频繁的输入账号和密码会很麻烦。

解决办法:
git bash进入你的项目目录,输入:
 

git config credential.helper store

如果是要求全局配置那就

git config --global credential.helper store

这样会在你本地生成一个文本,上边记录你的账号和密码。

使用上述的命令配置好之后,再操作一次git pull操作,它会提示你输入账号密码,这一次之后就不需要再输入密码了。

如果你之前不小心配置了全局的话,切换到你项目所在的目录下

  1. //删除 store 配置
  2. git config --global --unset credential.helper store
  3. //添加 store 配置
  4. git config credential.helper store

当然配置manager的存储方式也是可以的

  1. //删除 manager配置
  2. git config --global --unset credential.helper manager
  3. //添加manager配置
  4. git config --global credential.helper manager

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Cpp五条/article/detail/457747
推荐阅读
相关标签
  

闽ICP备14008679号