What is the main branch?
The main branch is the usual default branch. Other branches merge into it, and hosts put it online. Main is only a name, and older repositories may call it master.
An example
You try a redesign on a branch. Main keeps the live version until you merge the redesign in.
Where you’ll meet it
- Make a change on a branch · Save your code on GitHub
- Open a pull request · Save your code on GitHub
- Merge it into main · Save your code on GitHub
- Make a change on a branch · Save your code on GitLab
- Open a merge request · Save your code on GitLab
- Merge it into main · Save your code on GitLab
- Should I set up Git and GitHub now or later? · Saving your code
- How do commits, branches, main and origin work? · Saving your code