Creating a Branch

Create a branch in the GitHub web UI that's subordinate to the main branch.

Prerequisites

  • You have a GitHub account and are logged in.
  • You have access to the repository where you want to create the branch.

Steps

  1. In your GitHub repository, make sure you’re on the Code tab.
  2. Check that the branch menu under the repository title shows the main branch. If you’re not on main, select it from the branch menu.
  3. Click the branch menu to open the Switch branches/tags dropdown menu.
  4. In the entry field with the search icon, enter a name for your new child branch.
  5. In the Branches tab of the dropdown, click Create branch <branch-name> from main.

Result

  • You’re automatically switched to the branch you've just created.
  • Both the main branch and your new branch are now displayed in the repository.

Next Step

Add a file to a branch