Is it possible to move the changes in a commit to before other changes on the tree so I can test those commits.
In this example I want to move 'Romoved sess_match_useragent' to before 'Updated core to 2.1.0' in the tree
Thanks
Yes, with git rebase -i refspec
.
Here, refspec
will be the identifier (either a SHA1 or a relative refspec) of the commit preceding your "Updated core" commit. This will open an editor with the commits and their order: move the pick
line for your commit right before the "Updated core" one and quit the editor: git will rewrite the branch.
Note that you may have to solve conflicts, however.
Read the help in the editor along with the list of commits, too: it contains a lot of useful tips, you can do plenty. For instance, just reword
commit messages if you have made spelling mistakes...
In your case, as pointed out, refspec
can he HEAD~17
, ie "17 commits before ref HEAD" (HEAD is always the tip of the branch you are currently on).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With