gitpractice.dev

brewly — Ch.2 · When both sides moved

Exercise 6 of 7

Before you start

The merge commit

If both branches have new commits, git cannot just move forward. It combines them in a merge commit, which has two parents.

Git opens an editor with a suggested message. Usually you keep it: press "Save and close".

git merge <branch>
merge the branch into the current one
git log --oneline --graph
draw how the commits connect
git branch -d <name>
delete the merged branch
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