DevOps Academy→
What is a Main Branch?

What is a Main Branch? | Harness Glossary | Harness

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

TL;DR

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:

← Previous:
Next: →‍

Related Articles

Get Started

Get Started with Harness AI

Try the full platform free. No module restrictions, no credit card.