Skip to content

Instantly share code, notes, and snippets.

@gbhasha
Created September 12, 2017 06:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gbhasha/0230971eb1376153ad1387af490c1572 to your computer and use it in GitHub Desktop.
Save gbhasha/0230971eb1376153ad1387af490c1572 to your computer and use it in GitHub Desktop.
Load user level git config based on the working folder
# put below code in ~/.gitconfig
[includeIf "gitdir:~/Projects/personal/"]
path = ~/.gitconfig-personal
[includeIf "gitdir:~/Projects/project1/"]
path = ~/.gitconfig-project1
[includeIf "gitdir:~/Projects/project2/"]
path = ~/.gitconfig-project1
# put below code in ~/.gitconfig-project1
[user]
name= Galeel Bhasha Satthar
email= username@domain1.com
# put below code in ~/.gitconfig-project2
[user]
name= Galeel Bhasha Satthar
email= username@domain2.com
# put below code int ~/.gitconfig-personal
[user]
name = Galeel Bhasha Satthar
email = username@gmail.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment