Managing branches
So far, we have been working with the main branch of our project called master
. Imagine this branch as a timeline, where each event is performed by a commit. This is very useful when there is some conflict and you need to go back to a previous version, undoing the changes of a specific commit.
However, if you are working in a team, it is common that you will need to add a functionality in some kind of sandbox before merging this functionality into the master branch. It is in this sort of scenario that Git branches will help us, allowing us to create a new project branch from an existing repository branch and work on it without affecting the functionality of the main repository.
To create a new branch, just go to the Git | New Branch. This will open a new window that asks for the branch name—the branch on which the new branch will be based— and a checkbox labeled Checkout branch, which, if checked, will transition to the new branch once it is created...