Loading tutorials
Intermediate · Mid: 13 chapters · 35 min read. States assumed prerequisites
Start readinggit add, git commit, git switch, and git log. You should know how a pull request and a remote branch relate. You should also have rebased a single branch before. Git 2.38 or newer is needed later in the tutorial, so check it now with git --version.git log. It also assumes you know a branch is a movable pointer to a commit, and that you have opened pull requests from remote branches. You need Git 2.38 or newer for later chapters, but nothing here requires it.git rebase on a single branch. You should also know how remote branches and pull requests relate. Nothing here needs Git 2.38 yet. That version matters in the next chapter, where the fix appears.git add, commit, switch, and log. It also assumes you know a branch is a movable pointer to a commit and that you have used git rebase on a single branch. You need Git 2.38 or newer.git rebase -i on a single branch and know that --update-refs moves every branch in a stack. Here you will see what the option writes into the todo list, and how editing that list changes the result.git rebase --update-refs moves every branch in a stack. Typing the flag each time is easy to forget. Forgetting it leaves the lower bgit rebase --update-refs on a stack and know that a branch is a pointer to a commit. The option is useful, but it moves fewer refs than people expect. Knowing what it skips explains most "why is this branch still on the old base?" surprises.git rebase --update-refs on a stack (covered earlier) and know how remote branches and pull requests relate. It needs Git 2.38 or newer.git rebase on a single branch, know that a branch is a pointer to a commit, and have Git 2.38 or newer installed. It covers the three-argument form of rebase that lets you choose exactly which commits move and where they land.git rebase on one branch and know how --update-refs moves every branch in a stack (Git 2.38 or newer). It also assumes you know how remote branches and pull requests work. The chapter covers one situation: the bottom branch of your stack was squash-merged, and yogit rebase --update-refs on a stack, can read git status during a rebase, and have resolved a merge conflict before. It needs Git 2.38 or newer.git rebase --update-refs on a stack, resolve conflicts, and read git log. You need Git 2.38 or newer. Here you learn to recover a stack after a restack goes wrong.git rebase --update-refs, push with --force-with-lease, and restack with --onto after a squash merge. It collects the habits that keep those commands cheap to run. A stack that is small, ordered, and restacked often rarely needs the recovery steps from earlier