git pull代码的时候重复要求输入用户名和密码的解决方案

101 阅读1分钟

方案一:在项目目录设置

git config credential.helper store

之后再进行一次pull操作,输入用户名和密码,以后则不需要了

方案二:设置全局配置

git config --global credential.helper store

重复方案一的第二步即可

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

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

也可通过配置manager的存储方式

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