How do I push to Git Repo given the following error: An internal Exception occurred during push: ssh://git@github.com/xxx/xxx.git: session is down

强颜欢笑 提交于 2019-11-30 04:56:22
FFL

I experienced the same issue. Resolution follows:

  • Delete origin push and fetch in remote(Eclipse view --> Git repositories).
  • Close Eclipse.
  • Go to .ssh folder(Users/.ssh) and delete the key files(public and private).
  • Start eclipse and regenerate the keys(Window --> Preferences --> General tab --> Network connections --> SSH2).
  • Copy the key and add it to github/SSH Keys
  • In Eclipse add new remote and push.

Edit You may not need to delete all the key files. If you have already added a key file previously (perhaps while setting up native Git), you can just add the name of that file in list of keys, and it will work.

Michael Lee

This seemed to work for me:

Do everything Firoz and Nishant say except push: https://stackoverflow.com/a/9889350

Create or edit the following file on your desktop:

File : ~/.ssh/config Content :

Host github.com
    User [your_github_username]
    Hostname github.com
    PreferredAuthentications publickey
    IdentityFile [path_to_private_key]

In your Eclipse Git Setup for your project do the following:

  1. URI : git@github.com:[repo_owner_username]/[repo_name].git
  2. Protocol : ssh
  3. Username : git
  4. Password : [leave_blank]
  5. Save and push.

See this GitHub SSH Help page for useful info: http://help.github.com/ssh-issues/

Worked for me after initially suffering through "session is down" and "cannot open git-upload-pack" errors. Hope it helps everyone else too.

Good luck!

Aneesh Garg

I faced the same problem and I found out solution which is extremely foolish.
I took following steps:

  • I logged into git repository of my project from browser and didn't sign out.
  • I copied the http url to push or pull from project repository from github.
  • I pasted the url in my eclipse plugin while pushing code (didn't use the already stored one even though both of them were same)

I don't know what and why but above steps have worked for me whenever I have faced above problem. I don't know why does eclipse throw such exceptions and why does it gets solved this way.

You can also try pushing using other ways outside of eclipse. for eg. `TortoiseGit` or `SmartGit` etc.

I had the same problem. I fixed it by pointing the JAVA_HOME variable to jdk 6. It was originally pointing to jdk 5.

I got this error message and it was fixed when one of my co-workers emailed me the two files id_rsa and id_rsa (MS Pub doc), I put them in C:Users\[userID]\.ssh, and shut down and restarted my IDE.

Asen52

I had this issue with EGit and solved it at last. Somehow sometimes things get messed up. If you can not solve it through Eclipse just go to your "git" folder with git bash with Windows. With Linux it is even easier: just open the terminal.

This problem occurs because of username, password, and ssh keys getting messed up. So, use the commands "git remote show origin" and make sure if the origin is username@github.com...... Sometimes Eclipse just puts "git" as a username so make sure you have the correct user name by changing it with the command git remote set-url origin https://usrname@github.com/restofthe url. It should automatically change the configurations in eclipse.

Best...

I also had this issue.

The following command in Git Bash, comes handy in such scenarios: git remote prune origin

This configured the Pull/Push in the corrupted branch.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!