git commits with different EMail addresses
If you do (like me) a lot of git clones for different branches etc on a lot of different projects, the chances are high, that you want to have different EMails for checkins. You can update the local .git/config file for every clone, but that is a error prone process.
I have written an alias for git, which sets the GIT_AUTHOR_EMAIL environment variable according to the setting of the remote origin for the git repo. If it is a local repo, the standard EMail from .gitconfig is used.
It is used in zsh by me, so if you use a different shell, your mileage may vary.
# alias alias git='GIT_AUTHOR_EMAIL=$(git_email) /usr/bin/git'
Here is a part of the .gitemail file i use.
Thanks for reading. Comment on this post!