Working with Git Branches

Creating a new branch

You can create a new branch in your terminal by using the command git branch and add the name of the new branch.

Another option is to use the following command:

git checkout -b [new branch name]

Switching back to master branch

When you want to switch back to your master branch, you can do this very easily with git checkout master.

Seeing all the branches you have

It can also be convenient to see a list of all the branches you have. You can use the command git branch -a to see this list.

Removing branches

Once you do not need a branch any longer, you can use git branch -d [branch name] to delete it.