How to manage multiple git “emails”
I have 2 kinds of git repos.
- Work-related code where I use my work email Id while git commits.
- Open Source code where I use my personal email id while git commits.
A lot of times, email mismatch happen. there is an easy solution for it.
The root cause of this mismatch is the “global” flag
git config --global user.email "EMAIL ID"
setting up “per repo” or “repo specific” user name and email is the solution.
Or you can directly edit the git config file.
It is quite easy to set up a “pre-commit” hook to verify If email is not specified.