Introduction

Branch in Git is like a parallel universe of your project.
It lets you work on new features without disturbing the main codebase.


Why Branches?

Imagine your project has a main branch.
You want to add a new feature. Instead of risking changes on main, you:

  1. Create a new branch.
  2. Work on it separately.
  3. Merge it back when ready.

Git provides the ability to create branches so developers can work on new features or bug fixes without disturbing the main codebase.
Changes you make to a branch are stored separately from other branches. You can switch between branches at any time. When your changes are ready and working, you can merge the branch back into your main branch.