【问题标题】:Failed to connect to github.com:8080无法连接到 github.com:8080
【发布时间】:2013-10-21 00:50:20
【问题描述】:

我创建了一个新的 Git 存储库,但无法使用终端推送它。

这就是我正在做的事情

git remote add origin https://github.com/dilipptt/first_app.git
git push origin master

以及我得到的回报:

错误:无法连接到github.com:8080;访问https://github.com/dilipptt/first_app.git/info/refs?service=git-receive-pack时连接被拒绝
致命:HTTP 请求失败

【问题讨论】:

  • 显示git remote show origin的输出
  • @EmilDavtyan dilip@linuxmint /media/dilip/New Volume1/rails_projects/first_app $ git remote show origin error: Failed connect to github.com:8080; Connection refused while accessing https://git@github.com:dilipptt/first_app.git/info/refs?service=git-upload-pack fatal: HTTP request failed
  • 为什么要连接到 8080 端口?你的$HOME/.gitrc 中有什么东西弄乱了端口号吗?
  • 也许您正在使用代理并且需要取消设置https_proxystackoverflow.com/a/6080561/694469

标签: git github


【解决方案1】:

随着您所做的更改,您配置的 GitHub URL 是错误的。您应该使用https://github.com/foo/bar.git 中的HTTP url 或git@github.com:foo/bar.git 中的SSH url

第二次添加源时,指定了git://git@github.com/dilipptt/first_app.git

您应该指定

git remote add origin git@github.com/dilipptt/first_app.git

请复制并粘贴错误中的文本,而不是发布屏幕截图。后者对于想要帮助你的人来说很难。

【讨论】:

  • 你能发布git remote -v的输出吗?
  • origin https://git@github.com:dilipptt/first_app.git (fetch) origin https://git@github.com:dilipptt/first_app.git (push)
  • 执行以下操作: 1. git remote rm origin 2. git remote add origin git@github.com:dilipptt/first_app.git 注意第二行中没有https://。干杯
猜你喜欢
  • 2013-04-16
  • 2011-07-03
  • 2017-05-13
  • 1970-01-01
  • 1970-01-01
  • 2013-04-24
  • 1970-01-01
  • 1970-01-01
  • 2019-03-14
相关资源
最近更新 更多