1,007 B
1,007 B
| title | seo_description | date | draft | snippet_types | |
|---|---|---|---|---|---|
| per company git config | how to configure git to use different emails per company / folder | 2022-06-03T10:49:40+02:00 | false |
|
Started new job this week and I wanted to have a seprate email on my work related repos then my personal ones. Cool thing is git supports conditional config file includes!
~/.gitconfig
# per-user git config
[user]
name = Travis Shears
email = t@travisshears.com
[includeIf "gitdir:~/company-x/"]
path = .gitconfig-company-x
~/.gitconfig-company-x
# Company X spefic git config
[user]
name = Travis Shears
email = travis.shears@company-x.com
Now any commits made under the directory ~/company-x will use the email travis.shears@company-x.com and not my personal email.