Push declined due to email privacy restrictions is an error you might receive if you push code to GitHub.

This error occurs when.

To remedy this, run this script after finding your noreply email within the GitHub Email Settings.

#!/bin/sh
# Push declined due to email privacy restrictions on GitHub
# See more details here
# https://jeffbailey.us/blog/2020/01/20/push-declined-due-to-email-privacy-restrictions-on-github/
# Best of luck! ๐Ÿ™Œ

# Should be in this format:
# <Numeric Value>+<Your GitHub Username>@users.noreply.github.com

echo "Enter your GitHub email. Example: 999999+jeffabailey@users.noreply.github.com"
read -r github_email

git config --global user.email "${github_email}"
git rebase -i
git commit --amend --reset-author
git rebase --continue
git push

See this Stack Overflow question for more details.