Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » Multiple .gitconfig files on one machine?
Multiple .gitconfig files on one machine? [message #1072029] Sun, 21 July 2013 22:51 Go to next message
Ken Winter is currently offline Ken WinterFriend
Messages: 1
Registered: July 2013
Junior Member
I'm a total newcomer to Git and EGit, trying to set up my first repositories. The tutorials I've consulted so far seem to say that the .gitconfig file is where my repository credentials (user name, email, and maybe password) are stored - and that there is just one .gitconfig file per machine.

My problem is that I need to set up two different Git repositories to sync with remote repositories for projects I'm doing for two different organizations. Each organization requires different credentials. How can I set this up so that each repository remembers the credentials appropriate to it?

~ Thanks
~ Ken
Re: Multiple .gitconfig files on one machine? [message #1072478 is a reply to message #1072029] Mon, 22 July 2013 21:16 Go to previous message
R Shapiro is currently offline R ShapiroFriend
Messages: 386
Registered: June 2011
Senior Member
There are three levels of configuration in Git: System, Global and Local. There is one System config per host . Typically it's located in etc/gitconfig relative to the installation root. This is NOT where you user-specific information goes. System settings apply to all users and all repositories, unless overridden.
Each user has his/her own Global configuration. This is typically located in ~/.gitconfig. Your personal info goes here. You could include passwords, though I never would. Global settings apply to all scenarios owned by that user, unless overridden.
Each repository or clone also has a local configuration, located in .git/config

The precedence is as you would expect: repository-local settings have precedence over Global settings which in turn have precedence over System settings.
Previous Topic:JGit - Enable word diff option for Diffs
Next Topic:Re: JGit - Enable word diff on Diffs
Goto Forum:
  


Current Time: Fri Mar 29 02:08:53 GMT 2024

Powered by FUDForum. Page generated in 0.02522 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top