Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
663 views
in Technique[技术] by (71.8m points)

Error in git push heroku master through ssh behind proxy

Brief Context:
Hi, I am a university student (behind proxy 10.3.100.211:8080), new to ROR, Git & Heroku and have been following Ruby on Rails tutorial. I solved the problem of pushing git repo through ssh using following config in my ~/.ssh/config file (and it worked perfectly after that):

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

Problem:

However, on following https://devcenter.heroku.com/articles/git to use heroku for online app deployment, I am getting following error:

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

My current status is: $ git remote -v

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

Can anyone help me with github.com like settings for heroku.com to be written in my ~/.ssh/config file for seamless connection through ssh behind proxy using PORT 443/22.

Any help will be highly appreciated.

Update (Some More Information) I tried following settings and got following errors:

Configuration:

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  

Another Configuration:

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  
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

In your .ssh/config write this :

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

and in your .git/config change

[email protected]

to

git_heroku

The full line for a remote will look something like:

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

git_heroku is an alias; you need to change your git config to use that alias.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...