Try unchecking the “Block command line pushes that expose my email” box in your email settingsand then pushing again. This is likely caused by a new GitHub setting that blocks command line pushes that expose your email address.
If you created your account on GitHub.com prior to July 18, 2017, your noreply email address from GitHub is [email protected] . 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.
When enabling the “Block command line pushes that expose my email” feature, you’ll also want to configure Git to use your no-reply email address. Don’t worry—this won’t affect your contribution graph. All commits will still be associated with your account.
Open Terminal.
Change the current working directory to the local repository where you want to configure the email address that you associate with your Git commits.
Find your GitHub noreply address in your GitHub's Personal Settings → Emails. It's mentioned in the description of the Keep my email address private checkbox. Usually, it starts with a unique identifier, plus your username.
Set an email address in Git. Use your GitHub-provided no-reply email address.
Setting your email address for every repository on your computer
git config --global user.email "{ID}+{username}@users.noreply.github.com"
Setting your email address for a single repository
git config user.email "{ID}+{username}@users.noreply.github.com"
Reset the author information on your last commit:
git commit --amend --reset-author
If you have multiple commits with your private e-mail address, see this answer.
Now you can push the commit with the noreply e-mail address, and future commits will have the noreply e-mail address as well.
git push
Once you configure Git, commits will use your alternate “noreply” email address, and any pushes that don’t will be rejected.
I experienced the same error: GH007
message as well and used the following to resolve the issue.
This may expose your email address though.
Open Emails section of github.com. Visit https://github.com/settings/emails.
Go to Keep my email addresses private
section and note down your donotreply
email id.
Open git terminal and set your donotreply
email id as your email id using following command:
git config --global user.email "<your_donotreply_email_id"
git reset --soft HEAD~1
git add .
git commit –m "<commit_message>"
git push
There is a solution, w/o exposing your email. The error occurred because you have configured your own email address in the git config --(global|system|local) user.email
.
If the same email is your Github email and you have selected the option to make your email private, this error gets flagged by git.
Helpfully, Github provides you with a no-reply email address which you can use for command line actions. Just check your Email settings on your Github Profile.
You can simply remove or undo the commit done with the user.name and before committing changes again, set another email for
git config --(global|system|local) user.email "<no-reply-email-here>"
.
Now when you try to push changes to your remote repo, the error should be gone.
You have probably enabled (or it is enabled now by default) the email privacy feature of GitHub.
It is detailed on this page at GitHub help.
In short, there is a toggle that you can enable (which is enabled on your account) that prevents any push where the user is your actual email address. You can use an anonymized address instead (or choose to disable the feature).
Details for both options are available at the same page.
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