Loading tutorials
Intermediate · Mid: 12 chapters · 35 min read. States assumed prerequisites
Start readinggit log, and merge. It explains what git rebase does internally, so the three-argument --onto form in the next chapters reads as a small extension and not a new command.git log, and that you know a branch is a movable pointer to a commit. You don't need to have used git rebase before.git log. It also assumes you know a branch is a movable pointer to a commit. A plain git rebase main helps, but you can learn the --onto form without it.git log. It also assumes you know that git rebase --onto <newbase> <upstream> <branch> replays the commits in upstream..branch onto newbase. Most --onto mistakes come from a wrong upstream, so you will learn to check it before you rungit log. It also assumes you know that a branch is a movable pointer to a commit. You should know what a plain git rebase main does, though you don't need to be fluent with it.git log. It also assumes you know the shape of git rebase --onto <newbase> <upstream> <branch> from the earlier chapters.--onto <newbase> <upstream> <branch> form and know that upstream..branch selects the commits to replay. It also assumes you are comfortable with git log and git rebase --continue.git log. It also assumes you know that git rebase --onto <newbase> <upstream> <branch> replays the commits in upstream..branch onto newbase.git rebase --onto, read git log --oneline --graph, and know that a branch is a pointer to a commit. A rebase feels destructive, but it is almost always reversible. Rebasing creates new commits and moves the branch pointer to them. The old commits stay in the repogit rebase --onto, you know that a rebase copies commits instead of moving them, and you have pushed a branch to a remote such as origin. It covers how to publish the rewritten branch without overwriting other people's work.git rebase --onto <newbase> <upstream> <branch> and know that a branch is a pointer to a commit. It also assumes Git 2.38 or later, which added --update-refs.