Advanced Git & Version Control
Q90 / 100

What is the difference between "git rebase" and "git rebase --onto"?

Correct! Well done.

Incorrect.

The correct answer is A) A plain "git rebase <base>" replays the branch's commits since diverging from <base> onto its tip, while "git rebase --onto <newbase> <oldbase> <branch>" replays only commits unique to <branch> since <oldbase> onto <newbase>, for moving a branch elsewhere

A

Correct Answer

A plain "git rebase <base>" replays the branch's commits since diverging from <base> onto its tip, while "git rebase --onto <newbase> <oldbase> <branch>" replays only commits unique to <branch> since <oldbase> onto <newbase>, for moving a branch elsewhere

Explanation

"--onto" gives precise control over the range of commits being replayed and their new base, which is useful in advanced workflows like removing an unwanted intermediate branch from a commit's ancestry or extracting part of a branch's history onto a fresh base.

Progress
90/100