Branching is a technique used in SCM to allow different versions of the same source code to exist in a single repository. A branch is a complete set of all the source code files and associated files that form one version of the source code.
Every repository has at least one branch. That branch is usually named main in a git repository. All other branches derive from main or branches derived from main. In this sense, main is the root branch. The main branch is also referred to as the Master Branch.
A branch contain a sequence of changes called commits (see next lesson for more details on commits). A branch can be represented as a line with a series of dots or circles. Each dot or circle represents a commit to the branch.
From: GIT Branch and its Operations - An Easy Understanding - Digital Varys
A new branch is created as a copy of its parent branch from the most recent commit on the parent branch. The most recent commit is referred to as the head of the branch. The new branch is also called a child branch.
When the code in the branch is working and tested, the code can be merged back into its parent branch, through a pull request (see future lesson for more details on GitHub Pull Requests).
Likewise, the branch can be brought up to date with its parent branch by pulling or fetching the changes made to parent branch since the branch was created or the last time changes were fetched. This is merging the parent branch into the [child] branch.
Branches are used to isolate code changes that is under development and therefore may break the current release of the software. Development can occur on a child branch without damaging the release branch. Once the development is done and the code has been tested, the development [child] branch can be merged back into the release [parent] branch.
Branches can also be used to separate the development of new features that are independent of each other. This allows one group of programers to work on one feature while other groups of programmers work on other features.
Another use of branches is to allow the support of previous releases of the software. Each release would have its own Master Branch. This allows for bug fixes to applied to older releases while still developing the next release.
The following links provide more information about branching in SCM and Git.
Git Branching - Branches in a Nutshell
GIT Branch and its Operations - An Easy Understanding