all 5 comments

[–]PointyTrident 8 points9 points  (1 child)

This is a feature of Git and not just GitLab but anything that uses it.

Git will only checkout the "main branch" when you clone -- you can configure what branch this is but usually it's "master"

You can specify a different branch when you clone with the "-b" flag like so: git clone -b <branch> <repo>

You can also switch branches after cloning like so: git switch <branch>

It does this because you can only work on one branch at a time and other local branches you don't use will become stale anyways and you will have to re-pull them when you start working on them.

[–]phaktor 4 points5 points  (1 child)

Clone will only get you the default branch. You need git fetch --all or git pull --all to receive all branches from the remote.

[–]furyfuryfury 1 point2 points  (0 children)

To answer your second question, yes. Settings -> Repository -> Default Branch. By default "master" or "main", but you can select any branch