Today I Learned

Conditional .gitconfig

You can have conditional configuration based on path that you are in for git. For example if you have two emails defined one for work and one personal you can tell git to load gitconfig based on path you are in.

In your .gitconfig add the following lines:

[includeIf "gitdir:~/work/"]              
        path = ~/work/.gitconfig           

And then create a .gitconfig file in the path above with whatever settings you need. A simple one would be to change the email of the user.

        email = ""

Git will load this file also for all the subdirectories of the work dir.