You can create a new branch with the help of the git branch command.Git lets you branch out from the original code base. This will create a merge commit, which will include all the differences between the 2 branches - in a single commit.
and you merge from the branch you want to update from: git merge another-branch. The Operations that can be performed on a branch: Create Branch You checkout the branch you want to update: git checkout my-branch. 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. After you set the new default branch, you can delete the previous default if you want. On the Branches page, select More options next to the new default branch you want, and choose Set as default branch. Under your project repo, select Branches. A repository can have only one master branch. This procedure might require you to Set Git repository permissions. 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.