From 110ea0c87e0344621f3e95c3ed6100b4394a910f Mon Sep 17 00:00:00 2001 From: Zachary Carlson <22893164+zack-carlson@users.noreply.github.com> Date: Fri, 20 Sep 2024 13:01:09 -0500 Subject: [PATCH] Update setting-your-commit-email-address.md If you have your public email accidentally in a new git config, you must reset commits that have this e-mail address. This is an attempt to include this in the docs near email settings. --- .../setting-your-commit-email-address.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/content/account-and-profile/setting-up-and-managing-your-personal-account-on-github/managing-email-preferences/setting-your-commit-email-address.md b/content/account-and-profile/setting-up-and-managing-your-personal-account-on-github/managing-email-preferences/setting-your-commit-email-address.md index 3b8eccf725dd..715fdf7ebeb4 100644 --- a/content/account-and-profile/setting-up-and-managing-your-personal-account-on-github/managing-email-preferences/setting-your-commit-email-address.md +++ b/content/account-and-profile/setting-up-and-managing-your-personal-account-on-github/managing-email-preferences/setting-your-commit-email-address.md @@ -112,3 +112,15 @@ You can change the email address associated with commits you make in a single re ``` 1. {% data reusables.user-settings.link_email_with_your_account %} + +### Resetting commits that violate your email privacy settings + +If you have accidentally committed to the repository with a public e-mail that should be private you will need to reset the author in your local commit by following these steps: + +```shell +git config --global user.email "ID+USERNAME@users.noreply.github.com" +git rebase -i +git commit --amend --reset-author +git rebase --continue +git push +```