Creating a branch
You can create a branch in different ways on GitHub Enterprise Server.
Note: You can only create a branch in a repository to which you have push access.
Creating a branch via the branches overview
- On your GitHub Enterprise Server instance, navigate to the main page of the repository.
- Above the list of files, click Branches.
- Click New branch.
- In the dialog box, enter the branch name and optionally change the branch source.
- Click Create branch.
Creating a branch using the branch dropdown
- On your GitHub Enterprise Server instance, navigate to the main page of the repository.
- Optionally, if you want to create the new branch from a branch other than the default branch of the repository, click Branches then choose another branch.
- Click the branch selector menu.
- Type a unique name for your new branch, then select Create branch.
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."
Note: If the branch you want to delete is the repository's default branch, you must choose a new default branch before deleting the branch. For more information, see "Changing the default branch."
If the branch you want to delete is associated with an open pull request, you must merge or close the pull request before deleting the branch. For more information, see "Merging a pull request" or "Closing a pull request."
- On your GitHub Enterprise Server instance, navigate to the main page of the repository.
- Above the list of files, click Branches.
- Scroll to the branch that you want to delete, then click .
If you delete a head branch after its pull request has been merged, GitHub checks for any open pull requests in the same repository that specify the deleted branch as their base branch. GitHub automatically updates any such pull requests, changing their base branch to the merged pull request's base branch. For more information, see "About branches."