New Project: git-multi-email

git-multi-email solves the issue of using multiple email addresses in Git on a single machine. It’s a global Git hook for changing your email address as necessary in the Git configuration local to the current repository as an alternative to changing your email address manually per repository.


For an example, consider the following directory structure on your machine:

├── acmatuc
│   ├── archive
│   ├── cpp-language-review
│   └── visualizer
└── astronomerio
    ├── my-other-project
    └── my-project

And the following configuration in your global .gitconfig (found at ~/.gitconfig on your machine):

# ...
    name = "Noah"
    email = ""
    astronomerio =
    acmatuc =

Normally, when a commit is made, is used as the email address.

Now, with git-multi-email, when a commit is made in a local repository anywhere within a folder named astronomerio, will be used as the email alias and set locally for future use in that repository. Similarly, when a commit is made in a local repository anywhere within a folder named acmatuc, will be used as the email alias. Otherwise, any commit outside of these directories will use the default email address.


Here’s a full demo using the example configuration:


If you were to remove a line from the [emails] section in your ~/.gitconfig file, then any Git repository where the email address changed within that directory will not automatically change back to the default email address (meaning git config will still be the overridden email address).

If you do come across this issue, a quick fix is to set the back to your default email address for that repository (ex: git config "").


There are no tests yet, but I’ve considered a solution that uses Docker for tests so that the tests are fully independent of existing Git configurations on a local machine.

That’s it! See the project on on GitHub for the installation guide.

Issues and pull requests are welcome!