So I have started to rebase a big branch on my current master (75 commits). I know it will take me a day or so. In the meantime, I need to address some comments on another PR.
How can I suspend my current rebase to amend my PR without re-cloning the repo or copying the folder (these would work of course)? Is this even possible?
Press the Esc key, type :wq! and press Enter key to save and exit the document.
You can run git rebase --abort to completely undo the rebase. Git will return you to your branch's state as it was before git rebase was called. You can run git rebase --skip to completely skip the commit.
If you don't want rebase to stop at each commit if you get any merge conflicts and want it to stop only once during the rebase process, you can squash all the commits into one in your fix/align-div-vertically branch by squashing them using interactive rebase before rebasing with the master.
So for example, if you rebase featureA branch onto your master branch, but you don't like the result of the rebase, then you can simply do git reset --hard featureA@{1} to reset the branch back to exactly where it was before you did the rebase.
There is no built-in way to "pause" a rebase that I know of, although you can certainly accomplish something like it with enough git finesse.
However, in the case you've described, a much simpler solution is simply to do your rebase in one working directory, and do the other changes you need to do in a different working directory.
To get a new working directory, you can either:
Use a simple git clone
to get a new working directory (AND a local repository, so you'll need to push/pull your results pack the original working directory).
Or, take a look at git worktree
, which can help you manage multiple worktrees using the exact same repository data.
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