gitpractice.dev

brewly — Ch.2 · Move between branches

Exercise 2 of 7

Before you start

One folder, many versions

Switching branches changes the files in your folder to match that branch. Files that only exist on another branch disappear until you switch back.

Nothing is lost: the commits stay on their branch.

git branch
list branches; * marks the one you are on
git switch <name>
switch to an existing 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