Git - Branches

By xngo on February 27, 2020

Show all branches

git branch -a
#    * buster
#      master
#      stretch
#      remotes/origin/buster
#      remotes/origin/jwm-not-working-from-0.9.5
#      remotes/origin/master
#      remotes/origin/stretch

Select branch

Select buster branch.

git checkout buster
#    Switched to branch 'buster'
#    Your branch is up to date with 'origin/buster'.

Show current branch

Confirm you are now working on that branch.

git branch
#    * buster
#      master
#      stretch

About the author

Xuan Ngo is the founder of OpenWritings.net. He currently lives in Montreal, Canada. He loves to write about programming and open source subjects.