In my ~/.gitconfig, I list my personal email address under [user], since that\'s what I want to use for Github repos.
But, I\'ve recently s
There is a simple solution that seems to work well for avoiding mistakes.
Simply remove the [user] section from your ~/.gitconfig, which will prevent you from making any commits without setting user.name for each repository.
In your ~/.bashrc, add some simple aliases for the user and email:
alias ggmail='git config user.name "My Name";git config user.email me@gmail.com'
alias gwork='git config user.name "My Name";git config user.email me@work.job'