I use both GitHub and GitLab and their respective private email address features. This means, however, that I have two different commit email addresses that can't be set globally.
When creating a new repository, previously I would have to set
user.email manually, but something like
email@example.com is a bit hard to
Using what I learned from Project specific git author, without the gas pains,
I created an alias that will set the
user.email config setting to the appropriate value:
git config --global alias.github 'config user.email "firstname.lastname@example.org"' git config --global alias.gitlab 'config user.email "email@example.com"'
Now when starting a new project that I plan to host on GitLab, for example, I can run the following commands to get things started:
git init git gitlab