Collaborating on Git & Git Hub – Branch
A Branch in Git is an independent line of development with a commit history. Each branch provides a dedicated recording space and has its own coding history (a line of commits).
Branches allow us to manage different versions of the same set of project files simultaneously. For example, one developer can work on adding a new promotion campaign feature while another developer is working on adding a new payment feature to the same web application.
Git provides a master branch as a default. Unless you create a new branch, all your work is done on the master branch. The branch to create a new feature is typically called a topic branch.
Once development is completed in a topic branch, you can merge it with the master branch or its parent branch.
With the branching functionality, you can efficiently collaborate with others. Or even you can utilize branches by yourself to manage versions to develop different features simultaneously.
More details of the Branch concept and operations will be explained in Chapter 5. Work With Branches.
master branch vs. main branch
When you create a repository from GitHub, the default branch name is main branch. The concepts of the master branch and the main branch are the same. Previously, the primary branch was called master branch; however, main branch as the primary branch name is becoming more mainstream.