gitpractice.dev

brewly — Ch.3 · Merge a colleague's branch

Exercise 9 of 9

Before you start

Branches from others

After a fetch, you can switch to a colleague’s branch by name. Git creates your own local branch that tracks theirs.

Once it is merged, delete it in both places: on your computer and on the server.

git fetch
learn about new branches
git switch <name>
check out their branch
git merge <branch>
merge it into the branch you are on
git push
publish the result
git push origin --delete <branch>
delete the branch on the server
git branch -d <name>
delete your local copy
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