Git config with multiple identities

Let’s say you work with multiple repositories, some personal, some work-related and you’re doing some freelance work for a friend or two. You definitely don’t want to use the same identity and expose your juicy don@fat.club email and the linked GPG key you sign your commits with. Or if you’re bipolar.
Let’s assume your git config is similar to this (just an example, not the same name and email address, of course).
$ git config --get user.name
Don Donnington
$ git config --get user.email
don@fat.club
Start by removing the existing global identity:


