GitHub is one of the most commonly used version control collaboration software in the development community.
Branches allow users to develop in an isolated environment without affecting the rest of the repository. Each repository has a main
branch, and all other branches come from existing branches. To merge the work on two or more branches, you must use a pull request.
The default branch on the new repository is set to main
, as it is the first and only branch on your repository at that time. The default branch is the one that is displayed to anyone viewing your repository. This is also the
You can change the default and set a different branch for pull requests and new commits.
If you only want to change the name of the default branch, look into renaming the branch. The process of changing the default branch is highlighted below.
Your branch must have more than one branch for the default branch to change.
Branches
.main
to reveal available options in the drop-down menu. Select the branch you want to set as the new default branch and click Update
.You have successfully changed your default branch.
Free Resources