【问题标题】:How can I changed git user password when changing user.name and user.email did not work?当更改 user.name 和 user.email 不起作用时,如何更改 git 用户密码?
【发布时间】:2021-02-16 21:20:27
【问题描述】:

我试过这样:

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

然后git fetch && git checkout 但没有:Git 仍然需要密码 老用户的。

【问题讨论】:

    标签: git github bitbucket


    【解决方案1】:

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

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

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

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

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

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-01-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-04-12
      • 2015-08-06
      相关资源
      最近更新 更多