In this tutorial you will learn how to list and create branches in Git using the “git branch” command.
Code used during this tutorial:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# Git View and create branches # git branch - List, create, or delete branches # List existing branches git branch # Current HEAD pointer ls -al .git/ cat .git/HEAD cat .git/refs/heads/master git log -n 1 # Create "feature" branch git branch feature git branch # Current HEAD pointer cat .git/HEAD cat .git/refs/heads/master # "feature" brach HEAD ls -al .git/ ls -al .git/refs/ ls -al .git/refs/heads/ cat .git/refs/heads/feature # Man page man git-branch |