【发布时间】:2021-01-27 04:00:06
【问题描述】:
我有一个 repo - 假设它的远程地址是 https://myself@bitbucket.org/myself/my-repo.git。我正在与我的同事共享此存储库 - 我已授予他对他帐户的此存储库的管理员访问权限。假设他的 bitbucket 帐户是 https://mycolleague@bitbucket.org。他克隆了 repo。但是,每当他尝试推送/拉取存储库时,git 都会询问我的帐户 (https://myself@bitbucket.org) 而不是他的帐户 (https://mycolleague@bitbucket.org) 的密码。如何更改 git 设置,以便 git 询问他的帐户 (https://mycolleague@bitbucket.org) 而不是我的?
提前致谢!
【问题讨论】:
-
您的同事克隆了
https://myself@bitbucket.org/myself/my-repo.git而不是https://mycolleague@bitbucket.org/myself/my-repo.git。修复它的方法是让您的同事编辑.git/config文件,找到引用repo 的[remote]条目并修复URL。应该不需要重新获取 repo。