O'Reilly logo

Mastering Git by Jakub Narębski

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

Working with branches

Branches are symbolic names for lines of development. In Git, each branch is realized as a named pointer (reference) to some commit in the DAG of revisions, so it is called branch head.

Tip

The representation of branches in Git

Git uses currently two different on-disk representations of branches: the loose format and the packed format.

Take, for example, the master branch (which is the default name of a branch in Git; you start on this branch in the newly-created repository). In loose format (which takes precedence), it is represented as the one-line file, .git/refs/heads/master with textual hexadecimal representation of SHA-1 tip of the branch. In the packed format, it is represented as a line in the .git/packed-refs file, ...

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