The name you assign to a branch is essentially arbitrary,
though there are some limitations. The default branch in a repository is
master, and most developers keep the repository’s most robust
and dependable line of development on that branch. There is nothing
magical about the name
master except that Git
introduces it during the initialization of a repository. If you
prefer, you can rename or even delete the
branch, although it’s probably best practice to leave it alone.
To support scalability and categorical organization, you can create a
hierarchical branch name that resembles a Unix pathname. For example,
suppose you are part of a development team that fixes multitudes of
bugs. It may be useful to place the development of each repair in a
hierarchical structure under the branch name
separate branches named something
you find you have many branches or are just terminally over-organized,
you can use this slash syntax to introduce some structure to your branch
One reason to use hierarchical branch names is that Git, just
like the Unix shell, supports wildcards. For instance, given the naming scheme
can select all
bug branches at once with a clever
and familiar shorthand.
git show-branch 'bug/*'
Branch names must conform to a few simple rules:
You can use the forward slash
/) to create a hierarchical name scheme. However, the name cannot end with ...