【问题标题】:Git hub pushing to a forked repoGithub 推送到一个分叉的仓库
【发布时间】:2013-07-12 01:31:27
【问题描述】:

我是 github 的新手,我似乎无法找到解决问题的方法,所以请多多包涵。

我正在尝试通过命令行在来自 aws 的 ec2 ubuntu 实例上推送我对分叉存储库所做的更改。对我的文件进行更改后,我提交了我更改的文件,然后将其推送到 git:

ubuntu@ip-172-31-33-24:~/bitstarter$ git push origin master
Username for 'https://www.github.com': edasaur
Password for 'https://edasaur@www.github.com':
fatal: Authentication failed

我假设这可能是我正在推送到分叉存储库这一事实的问题,因为当我尝试提交并将更改推送到我启动的存储库时,它似乎有效。但是,我不知道该怎么做。当我通过以下命令测试我的 SSH 密钥是否有效时:

ubuntu@ip-172-31-33-24:~/bitstarter$ ssh -T git@github.com
Hi edasaur! You've successfully authenticated, but GitHub does not provide shell access.

提前致谢!

【问题讨论】:

  • 即使使用分叉的回购也应该可以工作。您确定凭据正确吗?如果改用 SSH 密钥并将远程更改为 ssh URL,会发生什么?

标签: github push


【解决方案1】:

首先,您正在使用 https 地址进行推送,因此您可能进行的任何 ssh 设置都不会影响 (https) 推送的完成。

其次,你应该使用的正确的 https url 是:

https://edasaur@github.com/edasaur/bitstarter.git

(不需要www.github.com)
(我喜欢把用户名放在url中:即推送时少输入一个数据)

这意味着您可以设置您的网址:

git remote set-url origin https://edasaur@github.com/edasaur/bitstarter.git

第三,仔细检查你的密码(看看里面是否有任何特殊字符,比如'@'、which might not be directly supported over an http query)

如果没有任何效果,您仍然可以使用 ssh url:

git remote set-url origin git@github.com:edasaur/bitstarter.git

【讨论】:

猜你喜欢
  • 2012-09-24
  • 1970-01-01
  • 2012-08-27
  • 1970-01-01
  • 2011-07-26
  • 2018-06-25
  • 1970-01-01
  • 2021-06-19
  • 1970-01-01
相关资源
最近更新 更多