gitpractice.dev

brewly — Ch.3 · See what changed on the server

Exercise 4 of 9

Before you start

Fetch only downloads

git fetch gets the new commits and updates origin/main. Your own branch and files stay as they are, so it is always safe.

A range like main..origin/main means: commits that origin/main has and main does not.

To take them in, merge origin/main into your branch.

git fetch
download new commits from the server
git log --oneline main..origin/main
what is new on the server?
git merge origin/main
bring it into your 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