:-) But after a long and frustrating rebase with a lot of conflicts, where you want to save what you've achieved so far and go back to non-rebase work before coming back at the rebase again later, the "quit" variant feels more satisfying somehow. (Or, you can leave the mess in place.) So you don't have to be clever enough to attach a branch name before the -quit. But if you choose -quit, Git terminates the rebase without moving HEAD, so that you wind up with: A'-B' <- HEADÄ«ut can get yourself a clean index and work-tree with git reset -hard now. Where are A' and B'? Well, if you know what you're doing, you can fish them out of the reflogs, or you already cleverly attached a branch or tag name to B' before choosing -abort. If you choose -abort, Git re-attaches your HEAD to feature, giving. You now have the two options, abort or quit. Let's say we decide to stop: that completing the cherry-pick of C is too hard for the moment and we need to back off and do something else for a bit. The sequencer stops, leaving you a mess in your index and work-tree, with the same graph we see above: A' and B' exist but C' does not. Let's say that also succeeds and we go on to attempt to cherry-pick C but this attempt fails. If you resume-or if things went well-we go on to (attempt to) cherry-pick B: A'-B' <- HEAD You can fix them and resume the sequencer (which will commit for you to make A' if needed, if you did not make A' yourself), or choose one of the two kinds of stop, "abort" or "quit". If so, the sequencer halts, leaving you a mess of merge conflicts in your index and work-tree. Since the op is "rebase", each step of the sequencer is a simple one-commit cherry-pick: (with) Git then detaches HEAD at the commit at the tip of mainline and runs the op, whatever it is, via the sequencer. This is why it needs to know the operation: are we continuing a cherry-pick, a revert, or a rebase?) The sequencer can stop partway through, then be resumed with -continue. The sequencer is also used for multiple reverts. (The sequencer also records the operation, in this case rebase / cherry-pick. It subtracts the mainline set from the feature set 2 and uses the reverse topological order so that it now has hash IDs A, B, and C listed in the thing that Git calls the sequencer. ) and those reachable from mainline (unnamed. Git starts out by enumerating the commits reachable from feature ( C, B, A, *. You want to bring feature up to date with mainline so you: git checkout feature Imagine you have the following series of commits. If you remember that git rebase is a sequence of git cherry-pick operations, 1 plus a couple of useful gimmicks at the start and end, it makes more sense.
2 Comments
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |