I usually submit a list of commits for review, so I have a problem:
If I have commit1, commit2,commit3, head.
I know that I can modify head commit with git commit --amend, but how can I modify commit1 that is not head commit.
I usually submit a list of commits for review, so I have a problem:
If I have commit1, commit2,commit3, head.
I know that I can modify head commit with git commit --amend, but how can I modify commit1 that is not head commit.
Sorry if I am wrong, but from what I understood reading some git tutorials, I think it would be rebase. Interactive mode (-i
) might help. Here is a related article which might help:
You can use git rebase, for example, if you want to modify commit bbc643cd, run
$ git rebase bbc643cd^ --interactive
In the default editor, modify 'pick' to 'edit' in the line whose commit you want to modify. Now you can use
$ git commit --amend
to modify the commit, and after that
$ git rebase --continue
to return back to the previous head commit.
http://git.or.cz/gitwiki/GitTips, second tip: "How to change commits deeper in history"