I'am currently converting a svn repository into a git one. As I proceed manually, I regularly change the user.name and user.email to set the author of the commit. Everything seems to work fine, but now I have to commit something from a user which has no email address. I removed email property from .gitconfig file and tried, but then in git log, email field shows user_login@user_login.(none)
. Is it possible to set no email and prevent git guessing one ?
When contributing to github, always use the anonymous noreply email address provided by github - which you can find here: https://github.com/settings/emails (have to tick "Keep my email addresses private" to see it). If using github or even if you're not, this is a better option than setting no email.
Git does not recommend to commit without any message. Moreover, you won't be able to track down these changes once you see the history.
You can get an ID-based noreply email address for GitHub by selecting (or deselecting and reselecting) Keep my email address private in your email settings.
I think that you can only do this with an explicit author specification:
git commit --author "Snail Mail <>"
You need the angle brackets so that git knows that you really are passing an empty email address.
Similar to neodelphi's comment, you can set this for all commits with
git config --global user.name 'Snail Mail' git config --global user.email '<>'
(You can use quotes instead of escaping.) To set this for the current project only, remove the --global
option only. i.e.
git config user.name 'Snail Mail' git config user.email '<>'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With