gitpractice.dev

brewly — Ch.3 · Publish a branch

Exercise 2 of 9

Before you start

Upstream branches

A new branch has no partner on the server yet. The first push names the server and the branch, and -u remembers the link, called the upstream. After that, plain git push is enough.

Remote-tracking branches such as origin/main are your last known view of the server.

git push -u origin <branch>
publish a branch and remember the link
git branch -a
list your branches and the remote ones
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