Last active
October 17, 2018 13:29
-
-
Save abinavseelan/706865be42a9d907f918a142f929ed24 to your computer and use it in GitHub Desktop.
Different gitconfigs for different folders
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
/* | |
If you have seperate github accounts for personal use and work, but use the same laptop. | |
Taken from this StackOverflow answer: https://stackoverflow.com/a/43884702 | |
*/ | |
/* | |
Have two folders, ~/company is going to house all your company repos and | |
~/personal is going to house all your personal projects | |
*/ | |
// In ~/.gitconfig | |
[includeIf "gitdir:~/company/"] | |
path = .gitconfig-company | |
[includeIf "gitdir:~/personal/"] | |
path = .gitconfig-personal | |
// In ~/.gitconfig-company | |
[user] | |
name = John Doe | |
email = [email protected] | |
// In ~/.gitconfig-personal | |
[user] | |
name = John Doe | |
email = [email protected] | |
For handling multiple ssh keys: https://medium.freecodecamp.org/manage-multiple-github-accounts-the-ssh-way-2dadc30ccaca |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment