gitpractice.dev

brewly — Ch.2 · Merge a finished branch

Exercise 5 of 7

Before you start

Merging

git merge <branch> brings that branch into the one you are on. So switch to the receiving branch first.

If main has not moved since the branch started, git simply moves main forward. That is a fast-forward: no new commit is needed.

A merged branch has done its job and can be deleted. -d refuses to delete work that is not merged.

git switch <name>
go to the branch that receives the work
git merge <branch>
bring the other branch in
git branch -d <name>
delete a 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