Re: how to reorder commits
- From
- Santi Béjar <santi@agolina.net>
- Date
- Jul 20, 2009, 15:37 UTC
- Message-ID
- <adf1fd3d0907200837k63f21504v3d660f9503962fcf@mail.gmail.com>
- In-Reply-To
- <f46c52560907200807heed4bbfkde15cccd2ae8151d@mail.gmail.com>
2009/7/20 Rustom Mody <rustompmody@gmail.com>:
Show 6 quoted lines
> I have a sequence of commits. I tried to reorder the top two in this way. > $ git rebase -i HEAD^^ > > flip the two pick lines and exit vi > > I find my file full of conflict markers.
"git rebase" applies the changes between the commit and the parent, and if the changes have conflicts this is what you get.
> So what is the way of doing: > HEAD becomes current HEAD^ > HEAD^ becomes current HEAD
$ git branch old $ git reset --hard HEAD~2 $ git read-tree old $ git commit -C old $ git read-tree old^ $ git commit -C old^
But normally you reorder "changes", not trees.
HTH, Santi