Skip to content

Instantly share code, notes, and snippets.

@katzefudder
Last active March 28, 2025 08:28
Show Gist options
  • Save katzefudder/3a6e2d8d06d71ae040bf6ca0c98f11d5 to your computer and use it in GitHub Desktop.
Save katzefudder/3a6e2d8d06d71ae040bf6ca0c98f11d5 to your computer and use it in GitHub Desktop.
just in case you are working on multiple projects (multiple git repositories) - you might have come across the need to have multiple identities regarding GIT. This is my approach
# ~/.gitconfig
# Different users per project/directory
[includeIf "gitdir:~/Code/private_project/"]
path = ~/Code/private_project/.gitconfig-private
[includeIf "gitdir:~/Code/project/"]
path = ~/Code/project/.gitconfig-project
# ~/Code/private_project/.gitconfig-private
[user]
name = John Doe
email = [email protected]
# ~/Code/project/.gitconfig-project
[user]
name = John Doe
email = [email protected]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment