Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Problems with pushing to github repository from Eclipse: Auth fail

I followed the steps from Egit user guide, but I get an error message with auth fail.

What I do:
I have copied the public key from Window > Preferences > Network Connections > SSH2 > Key Management to GitHub under account settings

Then I do
Team > Push...
I enter the [email protected]:.... uri and click next. But then I get the error:

**Cannot get remote repository refs  
Reason: [email protected]:....  : Auth fail**

What could be the problem?

Thanks

like image 362
Derk Avatar asked Jan 06 '11 11:01

Derk


2 Answers

Old question, but for future reference:

Make sure you did setup a push remote. It worked for me when I got both the Cannot get remote repository refs-problems ("... Passphrase for..." and "Auth fail" in the "Push..." dialog).

Provided that you already:

  1. Setup your SSH keys with Github (Window > Preferences > General > Network Connections > SSH2)

  2. Setup your local repository (you can follow this guide for that)

  3. Created a Github repository (same guide)

... here's how you do it:

  • Go to the Git Repositories view (Window > Show View > Other > Git Repositories)
  • Expand your Repository and right click Remotes --> "Create Remote"
  • "Remote Name": origin, "Configure push": checked --> click "OK"
  • Click the "Change..." button
  • Paste your git URI and select protocol ssh --> click "Finish"
  • Now, click "Save and Push" and NOW you should get a password prompt --> enter the public key passphrase here (provided that you DID (and you should) setup a passphrase to your public key) --> click "OK"
  • Now you should get a confirmation window saying "Pushed to YourRepository - origin" --> click "OK"
  • Push to upstream, but this time use "Configured remote repository" as your Destination Git repository
  • Go get yourself a well earned cup of coffee!
like image 50
Roger Avatar answered Oct 24 '22 19:10

Roger


Check my solution from this related question: "Auth Failed" error with EGit and GitHub

Briefly: set GIT_SSH environment variable with a path to the system ssh executable before launching Eclipse. Far from nice but works.

For Ubuntu:

> export GIT_SSH=/usr/bin/ssh
> eclipse
like image 33
Akseli Palén Avatar answered Oct 24 '22 17:10

Akseli Palén