I want to push commits to GitHub and followed the directions from How to Use Git/GitHub with R. Unfortunately, I ran into issues running the following code as my personal email is private.
library(usethis)
use_git_config(user.name = "MyUserName",
user.email = "[email protected]")
I have attempted to change my personal email to the public one provided by GitHub two ways. First, using:
use_git_config(user.name = "MyUserName",
user.email = "{ID}+{username}@users.noreply.github.com")
Second, by changing my email in the terminal:
git config --global user.email "{ID}+{username}@users.noreply.github.com"
git config --global --list
The latter line does show that the email was correctly updated.
I've also restarted R/RStudio, but I still get the same error messages when I try to push the commit. Error message:
remote: error: GH007: Your push would publish a private email address.
remote: You can make your email public or disable this protection by visiting:
remote: https://github.com/settings/emails
To https://github.com/repository
! [remote rejected] HEAD -> main (push declined due to email privacy restrictions)
error: failed to push some refs to 'https://github.com/repository'
What can I do to resolve this issue?