To branch off the current branch
git branch mybranchname
git checkout -b mybranchname <- create a branch and check it out
git checkout mybranch <- swap to this branch
Show all information about branches
git branch -a
master
mybranch
sometherbranch
coolbranch
remotes/origin/HEAD -> origin/master
remotes/origin/mybranch
remotes/origin/sometherbranch
remotes/origin/fredsbranch
git branch --set-upstream timsidea remotes/origin/timsidea
=> sets bi-directional link to the remote repository
detached head
This is when you have checkedout a HASH that is not the latest.
Note: You can branch from this point.