Skip to content

Instantly share code, notes, and snippets.

@elgalu
Forked from carlosmcevilly/gist:2221249
Last active January 4, 2016 12:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elgalu/8621102 to your computer and use it in GitHub Desktop.
Save elgalu/8621102 to your computer and use it in GitHub Desktop.
Fix commit author of last commit
  1. Fix your email address in git config
git config user.name "Your Name"
git config user.email "your@address.com"
git submodule foreach --recursive 'git config user.name "Your Name" && git config user.email "your@address.com"'
  1. Rebase
EDITOR=vim git rebase -i HEAD~1
  1. In the editor, mark the commit as 'edit' then save and exit the editor

  2. Do an amend that resets the author now that your address is changed:

EDITOR=vim git commit --amend --reset-author
  1. Finish with a rebase:
git rebase --continue

Git should say:

# Successfully rebased and updated refs/heads/master.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment