Branching is a very useful feature provided by Git. It helps to develop multiple features in parallel. Branching can be useful to define environment specific codes such as develop, test, stage, and production. Usually, the environment to Git branch mapping will be, for example, the code for the development environment stored in the
develop Git branch; for the test environment, we use the
test Git branch, and so on. For the production environment, we use the
master branch, as it is the first default branch created when we create any Git repository.
- Log in to GitLab.
- Go to your repository,
Sample, that we created in the Creating your first project in GitLab section:
- As you see in this screenshot, we have only one branch which is the master, and is the default branch.
- Click on
Branch, you will be redirected to a page where you can see all the active branches for this repository. Currently, we have a
- Click on...