Search code examples
eclipsegitwindows-authenticationegit

Authentication failed - Cannot clone remote repository by Git (Only occurred in Eclipse)


I am on Eclipse 2018.12 (actually same issue occurs from other version like Mars2 or Scala-IDE 4.7), I am struggling to get Git/EGit pass authentication while cloning remote repository, which is deployed on my company's server.

The same issue never occur while I am using Git command like or Git GUI or IntelliJ, but only by Eclipse (regardless of Eclipse version or any type of Git plugin)

I think the difference here is from Git bash or Git GUI or IntelliJ, the authentication is implicitly by verifying my Windows credential from local OS credential store with remote server. So Git bash/GUI and IntelliJ never pop up the login screen.

However, the default setup page from Eclipse asks for username/password every time. And after I enter the correct information, the same pop up message just show up again and again, like a sign that the authentication never pass.

Please see screenshot below.

Setup remote repository

Same login screen pops up again and again

Is there anyway to let Eclipse to follow the same way of authentication like Git


Solution

  • Same issue here. Seems that eGit doesn't support Windows Authentication where as command line Git does.

    Work around is to use a Personal Access Token as the password and anything as the username.

    You can create a PAT by logging into your TFS/Azure DevOps Website, click on your profile icon at the top right, select Security. Then create a new Personal Access Token and copy the token into the password box in eclipse. Maximum life of a token is 1 year, so you'll need to make a new one every year.