A. To specify credentials individually for each remote
- Open Git repositories view,
- open "
Remotes > origin > <your push url>
" - click "Change Credentials..."
(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.
- Create a text file called
.netrc
(_netrc
in Windows) in the user home directory. - Add content to the file in this form:
machine my.server1.com login yourUserName password yourPassword machine my.server2.com login yourUserName password yourPassword
The Stash documentation contains more information about .netrc
Security issue The problem with using .netrc this way is that the password is visible in plain text. Refer to this answer in Stackoverflow to solve that problem.