Creating a branch
Create a branch for a separate place to work on changes before opening a pull request.
メモ
You can only create a branch in a repository to which you have write access.
Creating a branch via the branches overview
-
GitHub で、リポジトリのメイン ページに移動します。
-
左側のファイル ツリー ビューで、 ブランチ ドロップダウン メニューを選んでから、[View all branches] をクリックします。 統合ファイル エディターの上部にあるブランチ ドロップダウン メニューも見つかります。

-
Click New branch.

-
Under "Branch name", type a name for the branch.
-
Under "Branch source", choose the repository and branch to base your new branch on.
-
Click Create branch.
Creating a branch using the branch dropdown
-
GitHub で、リポジトリのメイン ページに移動します。
-
Select the branch dropdown menu, in the file tree view or at the top of the integrated file editor.

-
Optionally, to create the new branch from a branch other than the default branch of the repository, click another branch. Then, select the branch dropdown menu again.
-
In the "Find or create a branch..." text field, type a unique name for your new branch, then click Create branch.

Creating a branch for an issue
You can create a branch to work on an issue directly from the issue page. See Issueの作業のためのブランチの作成.
Deleting a branch
Delete branches that you no longer need, such as branches for merged or closed work.
プルリクエストがリポジトリにマージされた後、head ブランチを自動的に削除することができます。 「ブランチの自動削除を管理する」を参照してください。
メモ
If the branch you want to delete is the repository's default branch, choose a new default branch first. See デフォルトブランチを変更する.
If the branch is associated with an open pull request, merge or close the pull request before deleting the branch.
-
GitHub で、リポジトリのメイン ページに移動します。
-
左側のファイル ツリー ビューで、 ブランチ ドロップダウン メニューを選んでから、[View all branches] をクリックします。 統合ファイル エディターの上部にあるブランチ ドロップダウン メニューも見つかります。

-
Next to the branch that you want to delete, click .

-
If the branch is associated with at least one open pull request, deleting the branch closes the pull requests. Read the warning, then click Delete.
プルリクエストがマージされた後にheadブランチを削除すると、GitHubは同じリポジトリ内に削除されたブランチをベースブランチと指定しているオープンなプルリクエストがないかをチェックします。 GitHubはそういったプルリクエストを自動的に更新し、ベースブランチをマージされたプルリクエストのベースブランチに変更します。 See Branches.