【git】解决每次push提交代码时要登录账号密码

我们在push代码的时候有时候可能会碰见每次push都需要输入登录用户的账号和密码,下面我写一下我的解决办法,希望对大家有用

取消弹出登录页面

首先我们在push后,有可能跳出登录页面
在这里插入图片描述

我们在git上输入

git config --system --unset credential.helper

或者

$ git config --global --unset credential.helper

在这里插入图片描述
如果不行,那么我们执行

$ git config --list

credential.helper=manager 是否存在,如果存在,那么可能执行到全局命令中了,如果存在,那么执行

git config --global --unset credential.helper

将其清除掉

取消登录SSH username和 password

在取消了登录账号密码后,还会跳出输入密码的问题
在这里插入图片描述
我们执行下面命令

git config --global credential.helper store

这个会在输入完一次密码之后进行缓存,在下次登录的时候就不在需要登录账号密码了

猜你喜欢

转载自blog.csdn.net/Black_Customer/article/details/112464604