Created
April 30, 2020 20:05
-
-
Save sodonnell/b20c7abc8230835cd68966e826f567d4 to your computer and use it in GitHub Desktop.
Managing multiple git configurations to separate work/personal identities and other configuration differences.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# file: ~/.gitconfig | |
# my name is the same in real life and at work. | |
[user] | |
name = "Sean O'Donnell" | |
# All repos/subdirectories in ~/projects/work/ shall respect my work email address/config. | |
[includeIf "gitdir:~/projects/work/"] | |
path = ~/projects/work/.gitconfig | |
# All repos/subdirectories in ~/projects/personal/ shall respect my personal email address/config. | |
[includeIf "gitdir:~/projects/personal/"] | |
path = ~/projects/personal/.gitconfig |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# file: ~/projects/personal/.gitconfig | |
# my personal email address. | |
[user] | |
email = "myusername@my.personal.domain.com" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# file: ~/projects/work/.gitconfig | |
# my work email address. | |
[user] | |
email = "myusername@my.employer.domain.com" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment