I just connected to GIT from Eclipse Juno using EGit, and successfully cloned a certain remote repository. During the clone I entered my Github username and password, but chose not to save them.
Then I tried to “Fetch from Upstream”. I got this error:
https://github.com/biunlp/nlp-lab.git: not authorized
I had no chance of entering my username and password…
This is strange since I connected to this repository in order to clone…
Update 2022: In what follows, always use:
So create your app password.
A. To specify credentials individually for each remote
Remotes > origin > <your push url>"(From User Guide – Resource Context Menu)
B. To specify credentials per server
If you want to access multiple repositories on the same server without providing the same credentials multiple times, you may use .netrc. With this, eGit will use the configuration you provide.
.netrc(_netrcin Windows) in the user home directory.machine my.server1.com login yourUserName password yourPassword machine my.server2.com login yourUserName password yourPasswordThe Stash documentation contains more information about .netrc
Security issue The problem with using
.netrcthis way is that the password is visible in plain text. Refer to this answer in Stackoverflow to solve that problem.More secure option (2022): EGit (from issue 441198) can be made (with an extension) to recognize a native Git credential helper, using a secure encrypted cache:
install a native Git
install the GCM (Git Credential Manager), which is cross-platform, and already package with Git For Windows for instance.
instruct EGit to look for credentials in the GCM:
gitflow-incremental-builder/gitflow-incremental-builderregister your password or token in said GCM
Look for executable
git-credential-manager-core, and add its folder to your%PATH%/$PATH.