35

I'm working onn a project in Eclipse hosted on Github. Everytime I want to push, a dialog pops up asking for username and password. Anybody know how to save these so I don't have to keep typing them in everytime? I'm using Egit in Eclipse 4.2.1

Khaelex
  • 742
  • 5
  • 15
sfendell
  • 5,415
  • 8
  • 25
  • 26
  • 1
    Did you solve this? I use Eclipse Juno on Win7. Using https and checking "Store in secure store" does nothing. Have to enter user and password every time. – A.W. Apr 18 '13 at 11:20
  • Sorry, I'm still entering my password every time like a chump :( – sfendell Apr 18 '13 at 18:30

8 Answers8

59

Struggled with this for a while too:

  1. Go to the Git Perspective -> Expand your Project -> Expand Remotes -> Expand the remote you want to save your password.
  2. Right-click on the Fetch or Push -> Select Change Credentials...
  3. Enter username and password -> Select Ok

This is the workaround I've found to work. It's a bit manual for each Git project, but it works ^_^.

hd84335
  • 8,815
  • 5
  • 34
  • 45
Sean Snyder
  • 624
  • 6
  • 3
  • This is the correct answer, with a modification. I went to git -> problematicrepository -> remotes and nothing was there, so I created one and set my credentials. That did the trick. – fivedogit Aug 25 '14 at 05:14
  • This did not work for me. Here is my question: http://stackoverflow.com/questions/27982209/eclipse-forget-my-git-password-and-username-everytime-after-i-do-a-push Do you know why? – Changwang Zhang Jan 16 '15 at 15:08
  • Thanks. This helped me delete my password as well. Instead of clicking 'Change Credentials', click 'Clear Credentials'. I accidentally saved my git password in eclipse on a computer at school and couldn't find a way to remove it until now. – vedi0boy Jan 21 '16 at 14:30
15

I had different problem. My credentials where saved permanently and I couldn't delete nor change them. Everytime I had Auth Fail from git and maybe You got same problem but in your case it prompts again. Maybe it will help You or others. I went to Preferences -> General -> Security -> Secure storage and in Contents tab deleted "Default Secure Storage" and restarted Eclipse. Then eGit asked me for password again and successfully saved it in storage.

rifle2000
  • 371
  • 2
  • 8
  • 1
    This is the right answer, because it changes the credentials globally, not just for one particular project. Use your github username and your github personal access token as the password. – ccleve May 25 '21 at 19:18
  • After upgrading to 2021-09 eclipse would never remember my git password and a git push would ask me 5 times for the password. Infuriating! This fixed it. – dan carter Nov 22 '21 at 07:14
7

You could use ssh url for your repo, and add your ssh public and private key to EGit.

Or you can activate a credential helper, in order to git to record your credentials.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
6

This can happen if the saved password in secure storage doesn't match with the typed one. Here's how you can fix it:

  1. From Eclipse toolbar navigate to Window > Preferences > Security > Secure Storage > Contents Tab > [Default Secure Storage] > GIT > "whatever github url"

  2. Select the url and delete the current user.

  3. Eclipse will ask for a restart. Do it.

  4. Push new changes and this time egit will prompt to save credentials in secure storage which was removed from the previous step.

Dennis
  • 186
  • 2
  • 9
2

That bug (for https URI) can be linked to the (still opened in 2014) bug 355442:

On every push, egit will ask for password (PAT: Personal Access Token) for a secure store.
The problem is, I never check the option to store the repository username and password (PAT) in the push dialog.

(Meaning if you forget to enter the credentials, it won't ask you again for it)

Reproducible: Always

Steps to Reproduce:

  1. Push to upstream with the "store username and password in secure store" option unchecked.
  2. push again.

Getting prompted constantly is pretty annoying but what is more annoying is that I have to uncheck the checkbox every time it shows up.
If the password is to be stored in the secure storage then the dialog will never prompt again. Wouldn't it make more sense for the checkbox to be unchecked by default?

So a workaround is to Remote>Fetch, using a "Custom URI" (as Antoine mentioned before), in order to enter again the URI, and enter your credentials there, selecting "Store in Secure Store".
Subsequent push should work fine, since they are using the same URI you just entered.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
2

Git Authentication After 2022 Update

Github deprecated the authentication. Using you username and password will not work.

Eclipse IDE Steps

  1. Request token by following [Github official instructions][1].
    • Tick the repo box, it will say something like "Full control of private repositories"
    • Set the time to either 30 days or more. Whatever makes you confortable
    • Copy the token, it will not be shown again.
    • Save the token to a text file in your computer.
  2. Go to Eclipse IDE
  3. Make changes to your files/code
  4. Access "Git Repositories" tab, if using java perspective it will be at bottom.
  5. Right click on Git project head tree. Select commit changes
  6. Username will be your github username
  7. Password will be your github token (that you just created)

Optional Steps

If you use more than 1 account in your computer and you use MS Windows OS.

  1. Access Credential Manager
  2. Select Windows Credentials -> Generic Credentials -> git:https: // github[dot]com.
  3. Delete the github account listed there.
  4. Close Credentials Manager
Full Array
  • 769
  • 7
  • 12
1

Secure Storage is your direct provider of credentials.

So, go to:

  • Window->Preferences->General->Network
  • Change Provider to "Direct"

This should really be the default since Secure Storage is the default provider in Eclipse.

You can also change the git preferences to not pop up confirmation dialogs and the overall result will be a very fast workflow

Dominic Cerisano
  • 3,522
  • 1
  • 31
  • 44
0

One workaround is:

  1. Navigate menu to Preferences -> General -> Security -> Secure Storage

  2. Uncheck OS X Keystore Integration to disable this master password provider, or:

    • Windows Integration case of window OS
    • Linux Integration case of Linux OS
  3. Apply and Close

This way, eclipse will rely on UI prompt instead of the OS keystore, and therefore you will key in your secure storage password just once after launching eclipse.

Here are some examples how others did it:

Tomerikoo
  • 18,379
  • 16
  • 47
  • 61
hd84335
  • 8,815
  • 5
  • 34
  • 45