In Git, a branch
is a new/separate version of the main repository.
A new branch is created to encapsulate the changes when you want to fix bugs or add new features.
When you want to add a new feature or fix a bug—no matter how big or how small—you spawn a new branch to encapsulate your changes.

To create a new branch there is a git branch
command.
git branch <branch-name>
After you have created a branch, you need to switch in this branch using a git checkout
command.
git checkout <branch-name>
But it is also possible to create a new Git branch and switch in this branch using only one git checkout
command with -b
option.
git checkout -b <branch-name>
After fixing the bug or adding new feature in the branch, it is possible to merge it with the master branch. To do that we need to change to the master branch:
git checkout master
Now we merge the current branch (master) with the <branch-name>. Read Git Branch Merge