Creating and deleting branches within your repository

Creating and deleting branches within your repository

You can create or delete branches directly on GitHub.

In this article

  • Creating a branch
  • Deleting a branch
  • Further reading

Were you able to find what you were looking for?

  •  Yes, easily
  •  Yes, eventually
  •  No
  Send

Creating a branch

  1. On GitHub, navigate to the main page of the repository.

  2. Optionally, if you want to create your new branch from a branch other than the default branch for the repository, click  NUMBER branches then choose another branch:

    Creating and deleting branches within your repository_第1张图片

     

  3. Click the branch selector menu.

    branch selector menu

     

  4. Type a unique name for your new branch, then select Create branch.

    Creating and deleting branches within your repository_第2张图片

     

Deleting a branch

You can have head branches automatically deleted after pull requests are merged in your repository. For more information, see "Managing the automatic deletion of branches."

You can't delete a branch if it's currently associated with an open pull request.

  1. On GitHub, navigate to the main page of the repository.
  2. Above the list of files, click  NUMBER branches.
    Creating and deleting branches within your repository_第3张图片
  3. Scroll to the branch that you want to delete, then click .
    delete the branch

你可能感兴趣的:(Creating and deleting branches within your repository)