Skip to content

Instantly share code, notes, and snippets.

@nothub
Created December 6, 2020 21:16
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 nothub/17944fafeed51f590af27ed0876718a9 to your computer and use it in GitHub Desktop.
Save nothub/17944fafeed51f590af27ed0876718a9 to your computer and use it in GitHub Desktop.
directory based gitconfig
[user]
name = a
email = a@foo.bar
[includeIf "gitdir:~/work/"]
path = ~/work/.gitconfig-work
[user]
name = b
email = b@foo.bar
# default user
Host github.com-a
Hostname github.com
User git
IdentityFile ~/.ssh/a.pub
# work user
Host github.com-b
Hostname github.com
User git
IdentityFile ~/.ssh/b.pub
# nullroute default domain
Host github.com
Hostname 100.127.255.255
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment