gitpractice.dev

brewly — Ch.6 · A conflict while rebasing

Exercise 2 of 8

Before you start

Stop, solve, continue

A rebase applies your commits one at a time. If one conflicts, it stops there. Solve the file, git add it, then continue. Git opens the editor with the commit message: save it.

The sides are swapped compared with a merge. You stand on the new base, so the first block is the base and the second is your commit. The buttons say which is which.

--abort returns to the start. --skip drops the commit that conflicts, so use it only when you do not want that change.

git rebase <branch>
start replaying
git status
where did it stop?
git add <file>
mark the file as solved
git rebase --continue
commit it and go on
git rebase --abort
give up and go back
git rebase --skip
drop the commit that conflicts
You can reopen this any time with “Lesson”.

Continue on a desktop

Typing git on a small screen is no fun. Open this page on a laptop or desktop to practise.

Back to the path