Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit » Multiple .gitconfig files on one machine?
Multiple .gitconfig files on one machine? [message #1072029] Sun, 21 July 2013 18:51 Go to next message
Ken Winter is currently offline Ken Winter
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 17:16 Go to previous message
R Shapiro is currently offline R Shapiro
Messages: 377
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 Apr 18 12:00:41 EDT 2014

Powered by FUDForum. Page generated in 0.02051 seconds