
Use Multiple Git Identities in the Same Environment
I often (re-)use the same laptop to work in different projects that have to be committed to Github under different identities.
By “identities” I do not mean different Github accounts.
I sign my commits with SSH key registered at Github to emails that are associated with my Github account.
Different types of projects are supposed to sign with different emails and keys.
I could call git config...
each time or maintain multiple .gitconfig
files in different directories.
However, there is more effective way IMHO.
The way is to use includeif setting of the Git configuration.
This is how it works.