I'm doing a Mercurial rebase (induced by hg histedit
) and I reach a conflict where I realize, actually, I should have dropped this patch. In git, I would have just done git rebase --skip
. Is there an equivalent in Mercurial?
@mittal: think of git rebase as copying commits from one branch onto another branch. So when you skip a commit, the original content of the commit is skipped and the patch is not applied (so all changes made to any file will not make it into your target branch).
move changeset (and descendants) to a different branch: hg rebase [-s REV | -b REV] [-d REV] [OPTION] Rebase uses repeated merging to graft changesets from one part of history (the source) onto another (the destination). This can be useful for linearizing local changes relative to a master development tree.
Sometimes during a Git rebase process, you may encounter some conflicting commits and wants to skip the specific commit for some reason. You can do that by passing the --skip flag in the git rebase command.
If you realize you should have dropped it, then the safe bet would be to do hg histedit --abort
, then redo hg histedit
and select drop
for that changeset.
The only downside is losing progress on any other changeset conflicts already resolved in the same operation. To avoid that, there's hg histedit --edit-plan
that allows changing the changeset to drop
, and then use hg histedit --continue
. But the current conflict still has to be resolved first, so for example hg resolve --all --mark
could be done first. But I think this depends on the details of the current situation and gets much more complex and risky, and in most cases is probably not worth the trouble.
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