One of the great powers of Git is the cheapness of creating branches. Branches are a way to create new code away from the central code path. You can see a branch as a tree, and you have a tree branch that sticks out of the tree.
So, when you want to test a new feature, just create a new branch. If you like the feature, you can merge it back. If you don't like the feature, you can remove the branch and no harm is done to the main branch.
In this recipe, we will take a look at how to create branches in Git, where you can find the branches in GitLab, and even how you can create a branch right in the GitLab interface.
You need to have a repository with at least one file, and commit changes in it. In the examples, I'll be using the
super-git project created at the start of this chapter.