Skip to content

Instantly share code, notes, and snippets.

@mrajo
Last active August 15, 2023 03:08
Show Gist options
  • Save mrajo/85b0f3ac3657d65d286688a7c57719ef to your computer and use it in GitHub Desktop.
Save mrajo/85b0f3ac3657d65d286688a7c57719ef to your computer and use it in GitHub Desktop.
# fix user with git config
# method 1: rebase with exec on all commits
git rebase -r --root --exec "git commit --amend --no-edit --reset-author"
# method 2: filter-branch
git filter-branch --env-filter '
CORRECT_NAME="<correct name here>"
CORRECT_EMAIL="<correct email here>"
export GIT_COMMITTER_NAME="$CORRECT_NAME"
export GIT_COMMITTER_EMAIL="$CORRECT_EMAIL"
export GIT_AUTHOR_NAME="$CORRECT_NAME"
export GIT_AUTHOR_EMAIL="$CORRECT_EMAIL"
' --tag-name-filter cat -- --branches --tags
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment