.gitconfig is usually stored in the user.home directory.
I use a different identity to work on projects for Company A and something else fo
As of git version 2.13, git supports conditional configuration includes. In this example we clone Company A's repos in ~/company_a directory, and Company B's repos in ~/company_b.
In your .gitconfig you can put something like this.
[includeIf "gitdir:~/company_a/"]
path = .gitconfig-company_a
[includeIf "gitdir:~/company_b/"]
path = .gitconfig-company_b
Example contents of .gitconfig-company_a
[user]
name = John Smith
email = john.smith@companya.net
Example contents of .gitconfig-company_b
[user]
name = John Smith
email = js@companyb.com