Skip to main content

このバージョンの GitHub Enterprise はこの日付をもって終了となりました: 2022-10-12. 重大なセキュリティの問題に対してであっても、パッチリリースは作成されません。 パフォーマンスの向上、セキュリティの向上、新機能の向上を図るために、最新バージョンの GitHub Enterprise にアップグレードします。 アップグレードに関するヘルプについては、GitHub Enterprise サポートにお問い合わせく� さい

Creating and deleting branches within your repository

この記事では、次の� �目が扱われます。

You can create or delete branches directly on GitHub Enterprise Server.

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 using the branch dropdown

  1. On your GitHub Enterprise Server instance, navigate to the main page of the repository.
  2. 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. Branches link on overview page
  3. Click the branch selector menu. branch selector menu
  4. Type a unique name for your new branch, then select Create branch. branch creation text box

Deleting a branch

プルリクエストがリポジトリにマージされた後、head ブランチを自動的に削除することができます。 詳細については、「ブランチの自動削除を管理する」を参照してく� さい。

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."

  1. On your GitHub Enterprise Server instance, navigate to the main page of the repository.
  2. ファイルの一覧の上にある [Branches](ブランチ) をクリックします。 概要ページのブランチのリンク
  3. Scroll to the branch that you want to delete, then click . delete the branch

プルリクエストがマージされた後にheadブランチを削除すると、GitHubは同じリポジトリ内に削除されたブランチをベースブランチと指定しているオープンなプルリクエストがないかをチェックします。 GitHubはそういったプルリクエストを自動的に更新し、ベースブランチをマージされたプルリクエストのベースブランチに変更します。 For more information, see "About branches."

Further reading