【发布时间】:2021-02-16 21:20:27
【问题描述】:
我试过这样:
git config --global user.name “username”
git config --global user.email "email"
然后git fetch && git checkout 但没有:Git 仍然需要密码
老用户的。
【问题讨论】:
我试过这样:
git config --global user.name “username”
git config --global user.email "email"
然后git fetch && git checkout 但没有:Git 仍然需要密码
老用户的。
【问题讨论】:
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>
【讨论】: