O'Reilly logo

Version Control with Git by Jon Loeliger

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Listing Branch Names

The git branch command lists branch names found in the repository:

$ git branch
  bug/pr-1
  dev
* master

In this example, three topic branches are shown. The branch currently checked out into your working tree is identified by the asterisk. This example also shows two other branches, bug/pr-1 and dev.

Without additional parameters, only topic branches in the repository are listed. As you’ll see in Chapter 11, there may be additional remote tracking branches in your repository. You can list those with the -r option. You can list both topic and remote branches with -a.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required