Fetch and Rebase
Task
The local main and main on origin have diverged: each has gained its own commit. Keep the history linear by moving the local work on top of the remote work.
Steps
- Download the current state of origin.
- Rebase the local
mainontoo/main.
Constraint
Do not use merge: the resulting history must not contain a merge commit.
Expected result
The remote commit must become the base, and the local one must be a new copy on top of it. HEAD must stay on main.
What you will learn
After completing this task you will be able to:
- detect a divergence between the local and remote history;
- combine fetch and rebase;
- keep the history linear when working together.
Goal
local
origin