Rebase edit doesn't amend files but only the commit message
By vvv... on August 22, 2013 13:45 (imported from Google Code)
Lets suppose the user wants to alter some history, not only the commit messages but some files as well (e.g. typo fix in source).
With command line git this is done intuitively:
- git rebase -i ...
- Mark relevant commit with "edit".
- Rebase stops at the relevant commit. Then, user can amend it as desired in the following way:
a. Edit the working tree for any additional changes desired to be included in the commit.
b. "git add" any files changed.
c. git commit --amend
d. git rebase --continue
However, in TortoiseGit the intuitive way doesn't work:
- Start rebase.
- Mark relevant commit with "edit".
- Rebase stops at the relevant commit and continues when user clicks "Amend". But the Amend effects only the commit message. Any changes to the working tree are ignored.
Of course there is a workaround to this. Once TortoiseGit stops at relevant commit, the user can edit the working tree and amend the commit manually using the Commit dialog prior to clicking the "Amend" button on the Rebase dialog. However, this creates another issue, effectively, amending is done twice in such scenario. First time in the Commit dialog and second time in the Rebase dialog. If the user changes the commit message, it requires coping it manually to the Rebase dialog, otherwise the second amend reverts to original commit message.