Skip to content

Instantly share code, notes, and snippets.

@baybatu
Created June 30, 2021 15:15
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save baybatu/292aa99501f86135fa5ee1401bf46fed to your computer and use it in GitHub Desktop.
Save baybatu/292aa99501f86135fa5ee1401bf46fed to your computer and use it in GitHub Desktop.
Using git profiles by current directory

~/.gitconfig:

[includeIf "gitdir:~/workspace/project1/**"]
    path = .gitconfig.project1
[includeIf "gitdir:~/workspace/project2/**"]
    path = .gitconfig.project2

~/.gitconfig.project1:

[user]
    name = Roberto Zubizaretta
    email = helehele@heyheyyamar.com

~/.gitconfig.project2:

[user]
    name = Comolokko Tanburibaykushasan
    email = comolokko@tanburibaykushasan.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment