Problems with pushing to github repository from Eclipse: Auth fail

39,446

Solution 1

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!

Solution 2

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

Solution 3

DO not forget to add .git to the repository name in the URI : field

for example if ur username is Decoderx and git repository name is foo URI :https://github.com/Decoderx/foo.git

and not "https://github.com/Decoderx/foo" this solved this problem for me.

Solution 4

I finally fixed this on my platform (mainly was a key issue but also critical not to have a leading slash before the repo path in the dialog pictured above). You can see more details in my post here, if you like:

http://www.eclipse.org/forums/index.php?t=msg&goto=648905&S=9bcfa96ab726d744d41a19c7fb02d723#msg_648905

Good luck!

Melissa

Share:
39,446

Related videos on Youtube

Derk
Author by

Derk

Updated on July 09, 2022

Comments

  • Derk
    Derk almost 2 years

    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

    • Derk
      Derk
      Now it works in Eclipse + Github. Unchecked the checkbox store in secure store. But in Zend Studio + my unfuddle account it is still not working. Here the error message is ERROR:gitosis.serve.main:Repository read access denied [email protected]:derk/demuno.git: ERROR:gitosis.serve.main:Repository read access denied
  • Derk
    Derk over 13 years
    Ok, I don't have the protocol option git+ssh in Eclipse. I tried with ssh but it gives the same error
  • VonC
    VonC over 13 years
    @Derk: what os are you using? What eclipse version and what EGit version?
  • Roger
    Roger about 12 years
    Thanks Melissa! Setting it up first in the git repositories view worked for me when nothing else did
  • Spencer Kormos
    Spencer Kormos almost 11 years
    Linking back to the tutorial that the OP already linked to, and without a comment, is far from productive.
  • LittleLebowski
    LittleLebowski over 10 years
    You saved my day. Thank you so much.
  • Kyle Bridenstine
    Kyle Bridenstine about 8 years
    This didn't do it for me.