Skip to main content



      Home
Home » Eclipse Projects » EGit / JGit » Multiple .gitconfig files on one machine?
Multiple .gitconfig files on one machine? [message #1072029] Sun, 21 July 2013 18:51 Go to next message
Eclipse UserFriend
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
Eclipse UserFriend
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: Wed Jul 16 02:42:59 EDT 2025

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

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

Back to the top