Table of Contents

Key takeaway

The main branch is the original thread of code for a project’s codebase.

What is a Main Branch?

The main branch of a project is considered the default branch. When anyone visits your repo and forks or clones it, that is the branch that gets checked out and served down locally to their machine.

Most deployments of code come directly from the main branch in git. GitHub, Bitbucket, and GitLab all use "main" as the default branch. Once you have a 1:1 clone of the main branch, you can cut a feature or bug fix branch off of that. Once code is tested and checked, a pull request can be submitted to bring the changes into the main branch.

Branch Naming

If you want to change the name of the main branch, you can. It is advised and best practice to leave the default name to main or change the branch name to main:

gitbranch-mmastermainBash
You might also like
What is a Merge Conflict?
Read More >
open source code repository​
Read More >
What is a Pull Request?
Read More >
What is Release Management?
Read More >
What is a Feature Branch?
Read More >
What are Application Versions?
Read More >