14 | Viewing Branches |
You need to be able to see what branches your repository has in it
so you can switch between them. You can use a visualization tool
such as gitk
[13] or GitX.[14] You can use git branch
to get the same information, however.
You can view local, remote, or all branches depending on which
parameters you pass to git branch
.
Calling git branch
by itself shows you
your local branches. You can add either the
-r
parameter or the
-a
parameter to view only the remote
branches or all the branches, respectively.
Your current branch always has an asterisk before it in the output
from git branch
. Itâs colored green if
you turned on color output (see Task 2, âConfiguring Gitâ). Likewise, remote branches are colored red if colors ...
Get Pragmatic Guide to Git now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.