80

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.
1
  • 4
    I just typed the exact title of this question into Google! +1 for useful title. Commented Jan 15, 2016 at 18:30

2 Answers 2

80
  • "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".
Sign up to request clarification or add additional context in comments.

1 Comment

Does the name of original committer changes if reword is used?
30

edit will pause the rebase entirely, allowing you to change files in the commit and/or the commit message.

reword will simply open an editor to let you change the commit message only.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.