Skip to content

Instantly share code, notes, and snippets.

@zapidan
zapidan / git-change-author
Last active September 18, 2024 06:47
Change previous commits author/email with filter-branch
## Make sure your local repo settings are correct
git config --local --list
git config --local user.name "author name"
git config --local user.email "[email protected]"
## Change previous n commits
git rebase -i HEAD~n
# choose the commits to change by adding 'pick' or 'reword' (only for changing the message)
git commit --amend --author="Author Name <[email protected]>"
# change first commit in repo