Skip to content

lab 48 Remote Branches

Goals

Let’s look at the branches available in our cloned repository.

Execute:

git branch

Output:

$ git branch
* (no branch)

That’s it, only the main branch is listed. Where is the greet branch? The git branch command only lists the local branches by default.

List Remote Branches

Try this to see all the branches:

Execute:

git branch -a

Output:

$ git branch -a
* (no branch)
  remotes/origin/excitement
  remotes/origin/greet
  remotes/origin/main

Git has all the commits from the original repository, but branches in the remote repository are not treated as local branches here. If we want our own greet branch, we need to create it ourselves. We will see how to do that in a minute.