git rebase - what's the difference between 'edit' and 'reword'

Snowcrash picture Snowcrash · May 12, 2015 · Viewed 11.1k times · Source

What's the difference between edit and reword when you do a git rebase?

I'm going through some docs which say this:

Replace pick with:
- edit to mark a commit for amending.
- reword to change the log message.

Answer

Chris Maes picture Chris Maes · May 12, 2015
  • "reword" allows you to change ONLY the commit message, NOT the commit contents
  • "edit" allows you to change BOTH commit contents AND commit message (the mechanism by which git allows you to edit the commit contents is by "pausing" the rebase; so you can amend the commit)

reference : The git-rebase documentation says this:

  • edit : By replacing the command "pick" with the command "edit", you can tell git rebase to stop after applying that commit, so that you can edit the files and/or the commit message, amend the commit, and continue rebasing.
  • reword : If you just want to edit the commit message for a commit, replace the command "pick" with the command "reword".