当更改 user.name 和 user.email 无效时,如何更改 git 用户密码?

How can I changed git user password when changing user.name and user.email did not work?

我这样试过:

 git config --global user.name “username” 
 git config --global user.email  "email"  

然后是 git fetch && git checkout 但是没有: Git 仍然需要来自 老用户的。

用户。name/email仅与提交作者有关,与身份验证无关。

git remote -v 检查您的确切 URL 以检查它是 HTTPS 还是 SSH (git@bitbucket.org)。
我提到 SSH 是因为有时私钥的密码被解释为“密码”。

如果是 HTTPS,请检查您的 git config credential.helper
根据您的OS,它可能是“manager”或osxkeychain或...

如果旧用户被缓存并使用,你需要remove it from the credential helper,然后尝试再次推送:应该会出现一个弹窗,要求你这次输入正确的user/password。

更改用户时的一个好提示是确保新用户登录是远程登录的一部分 URL:

cd /path/to/repo
git remote set-url origin https://<New-Username>@bitbucket.org/<aUser>/<aRepo>