git push heroku master 通过代理后面的 ssh 出现错误

2024-05-07

简要背景:
大家好,我是一名大学生(代理 10.3.100.211:8080),刚接触 ROR、Git 和 Heroku,一直在关注 Ruby on Rails 教程。我解决了通过 ssh 推送 git repo 的问题,在我的 ~/.ssh/config 文件中使用以下配置(之后它工作得很好):

Host github.com  
Hostname ssh.github.com  
User git  
ProxyCommand corkscrew 10.3.100.211 8080 %h %p  
Port 443  

Problem:

然而,在接下来的https://devcenter.heroku.com/articles/git https://devcenter.heroku.com/articles/git使用heroku进行在线应用程序部署,我收到以下错误:

$git push heroku master
ssh: connect to host heroku.com port 22: Connection refused  
fatal: The remote end hung up unexpectedly  

我当前的状态是: $ git remote -v

heroku  [email protected] /cdn-cgi/l/email-protection:deep-dusk-1030.git (fetch)  
heroku  [email protected] /cdn-cgi/l/email-protection:deep-dusk-1030.git (push)  
origin  [email protected] /cdn-cgi/l/email-protection:shaileshgupta/testapp.git (fetch)  
origin  [email protected] /cdn-cgi/l/email-protection:shaileshgupta/testapp.git (push)  

任何人都可以帮助我将 github.com 与 heroku.com 的设置写入我的 ~/.ssh/config 文件中,以便使用端口 443/22 通过代理后面的 ssh 进行无缝连接。

任何帮助将不胜感激。

更新(更多信息)我尝试了以下设置并收到以下错误:

配置:

Host heroku.com  
  Hostname ssh.heroku.com  
  User git  
  ProxyCommand corkscrew 10.3.100.211 8080 %h %p  
  Port 443  

Error:

$ git push heroku master  
ssh_exchange_identification: Connection closed by remote host  
fatal: The remote end hung up unexpectedly  

另一种配置:

Host github.com, heroku.com  
  Hostname ssh.github.com  
  User git  
  ProxyCommand corkscrew 10.3.100.211 8080 %h %p  
  Port 443  

Error:

$ git push heroku master  
ERROR: Repository not found.  
fatal: The remote end hung up unexpectedly  

在你的 .ssh/config 中写下:

Host git_heroku
  Hostname heroku.com
  User git
  ProxyCommand corkscrew 10.3.100.211 8080 %h %p
  Port 443

并在您的 .git/config 更改中

[email protected] /cdn-cgi/l/email-protection

to

git_heroku

遥控器的完整线路将类似于:

[remote "appname"]
  url = git_heroku:appname.git
  fetch = +refs/heads/*:refs/remotes/appname/*

git_heroku是一个别名;您需要更改 git 配置才能使用该别名。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

git push heroku master 通过代理后面的 ssh 出现错误 的相关文章

随机推荐