
You can set the name of the default branch for new repositories. For more information, see " Changing the default branch." You can change the default branch for an existing repository.
Branch twig code#
Unless you specify a different branch, the default branch in a repository is the base branch for new pull requests and code commits.īy default, GitHub names the default branch main in any new repository. The default branch is also the initial branch that Git checks out locally when someone clones the repository. The default branch is the branch that GitHub displays when anyone visits your repository. This first branch in the repository is the default branch. When you create a repository with content on, GitHub creates the repository with a single branch. For more information, see " Access permissions on GitHub." About the default branch You must have write access to a repository to create a branch, open a pull request, or delete and restore branches in a pull request. For more information, see " About GitHub Pages." You can also use a branch to publish a GitHub Pages site. For more information, see " Creating and deleting branches within your repository."

A branch you create to build a feature is commonly referred to as a feature branch or topic branch. You can then work on this new branch in isolation from changes that other people are making to the repository. Typically, you might create a new branch from the default branch of your repository. You always create a branch from an existing branch. Branches allow you to develop features, fix bugs, or safely experiment with new ideas in a contained area of your repository.
