ブランチの作成
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
- GitHub Enterprise Serverインスタンスで、リポジトリのメインページにアクセスしてください。
- Above the list of files, click Branches.
- Click New branch.
- In the dialog box, enter the branch name and optionally change the branch source.
If the repository is a fork, you also have the option to select the upstream repository as the branch source. - Click Create branch.
Creating a branch using the branch dropdown
- GitHub Enterprise Serverインスタンスで、リポジトリのメインページにアクセスしてください。
- 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.
- ブランチセレクタメニューをクリックします。
- 新しいブランチに、一意の名前を入力して、[Create branch] を選択します。
ブランチの削除
プルリクエストがリポジトリにマージされた後、head ブランチを自動的に削除することができます。 詳しい情報については「ブランチの自動削除の管理」を参照してください。
注釈: 削除するブランチがリポジトリのデフォルトブランチである場合は、ブランチを削除する前に新しいデフォルトブランチを選択する必要があります。 詳しい情報については「デフォルトブランチの変更」を参照してください。
削除するブランチがオープンなプルリクエストに関連付けられている場合は、ブランチを削除する前にプルリクエストをマージまたはクローズする必要があります。 詳しい情報については、「プルリクエストをマージする」または「プルリクエストをクローズする」を参照してください。
- GitHub Enterprise Serverインスタンスで、リポジトリのメインページにアクセスしてください。
- Above the list of files, click Branches.
- 削除対象のブランチまでスクロールし、をクリックします。
プルリクエストがマージされた後にheadブランチを削除すると、GitHubは同じリポジトリ内に削除されたブランチをベースブランチと指定しているオープンなプルリクエストがないかをチェックします。 GitHubはそういったプルリクエストを自動的に更新し、ベースブランチをマージされたプルリクエストのベースブランチに変更します。 詳細は「ブランチについて」を参照してください。