.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
Another way is to use direnv and to separate config files per directory. For example:
.
├── companyA
│ ├── .envrc
│ └── .gitconfig
├── companyB
│ ├── .envrc
│ └── .gitconfig
└── personal
├── .envrc
└── .gitconfig
Each .envrc should contain something like this:
export GIT_CONFIG=$(pwd)/.gitconfig
And .gitconfig is usual gitconfig with desired values.