gitpractice.dev

brewly — Ch.5 · Bring your branch up to date

Exercise 4 of 6

Before you start

Updating a branch

If main gained commits after you branched, many teams ask you to include them first, so that what gets merged has been seen together.

Fetch, then merge origin/main into your branch, and push. The pull request updates itself. Keep the suggested merge message.

git fetch
learn what is new on the server
git merge origin/main
bring main into your branch
git push
update the pull request
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