繁体   English   中英

当我尝试推送时,git提示我输入别人的密码

[英]git is prompting me for someone elses password when I try to push

我正在尝试对正在编辑的一个大项目进行初步推送(我不是原始作者),当我去推送该项目时,我的github仓库要求我在bitbucket上输入别人的密码?

我尝试在github上创建一个新帐户并重置全局用户名/密码,删除了钥匙串上与git相关的所有文件,并尝试更改目录名称。

项目名称darrinwebster $ git push -u origin master

“ otherPersonsBitbucketAccount.org”的密码:

远程:无效的用户名或密码

致命的:“ otherPersonsBitbucketAccount.org”的身份验证失败

我期望git要求我提供凭据(适用于github),因为我已将存储库来源设置为我的帐户。

您可能希望将origin远程站点的URL重置为指向您的GitHub帐户,而不是其他人的Bitbucket帐户。 您可以使用以下类似方法执行此操作:

git remote set-url origin https://github.com/example-user/example-repo.git

如果您愿意,也可以使用SSH URL:

git remote set-url origin git@github.com:example-user/example-repo.git

如果需要,您可以仅添加其他远程,然后推送到该远程:

git remote add github https://github.com/example-user/example-repo.git
git push -u github master

您当然可以使用您控制的任何URL。 如果您想使用Bitbucket帐户而不是GitHub帐户,那很好。

Git从git config中获取用户名,所以我将从检查git config( git config --global user.name )中的用户名开始。 如果出现问题,您可以使用git config --global user.name "John Doe"更改用户名。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM