You can create a new branch with the help of the git branch command. The Operations that can be performed on a branch: Create Branch As someone who has been writing books for ten years such as the 2021 Scala Cookbook and Functional Programming, Simplified I haven’t worked on many open source projects, so my ability to fork a Github project, pull it down, create a branch, push that branch back, and then submit a pull request are weak, at best. So, the git branch is tightly integrated with the git checkout and git merge commands. Many operations on branches are applied by git checkout and git merge command. The git branch command allows you to create, list, rename and delete branches. We can perform various operations on Git branches. It can be called as an official working version of your project. Master branch is the branch in which all the changes eventually get merged back. A repository can have only one master branch. When you start making a commit, then master branch pointer automatically moves forward. When you make the first commit, you're given a master branch to the starting commit point. It is instantiated when first commit made on the project. The master branch is a default branch in Git.
So, it is complex to merge the unstable code with the main code base and also facilitates you to clean up your future history before merging with the main branch. When you want to add a new feature or fix a bug, you spawn a new branch to summarize your changes. These branches are a pointer to a snapshot of your changes. A Git project can have more than one branch. It is a feature available in most modern version control systems.
A branch is a version of the repository that diverges from the main working project.