jacob-tate
12/4/2019 - 3:37 AM

git: Branching

List all local branches in a repository

git branch

List all local and remote branches in a repository

git branch -a

Create a new branch, referencing the current HEAD

git branch [name]

Switch working branch

git checkout [name]

Switch working branch creating it if it doesnt exist

git checkout -b [name]

Join specified branch into current branch (the one you have checked out)

git merge [from name]

Remove selected branch if its merged into another

git branch -d [name]

Remove selected branch forced

git branch -D [name]