Previous: , Up: Branches are state   [Contents][Index]

2.4.3 A Closer Look at Branch Naming

Earlier, we said that Git maintains copies of the branches in the upstream repo, as well as manages your local branches. You can see all these branches with ‘git branch -a’:

$ git branch -a
-|   gawk-4.1-stable
-| * master
-|   remotes/origin/HEAD -> origin/master
-|   remotes/origin/dead-branches/async-events
-|   …
-|   remotes/origin/feature/api-mpfr
-|   remotes/origin/feature/array-iface
-|   remotes/origin/feature/fix-comments
-|   …

You’ll note that what we’ve referred to as ‘origin/’ branches appear in the output with an additional prefix: ‘remotes/’. Up to this point, we’ve treated Git as if it allowed only a single upstream repository. But in fact, you can configure it to use more than one. All the known upstream repositories are grouped under the ‘remotes/’ prefix, with remotes/origin being the one from which you initially cloned your local repository.

The ability to work with multiple upstream repositories is an advanced one; gawk development does not make use of it. The intent of this subsection is to explain the output from ‘git branch -a’, nothing more.