メモ
Pull request authors can give upstream repository maintainers, or people with push access to the upstream repository, permission to make commits to their pull request's compare branch in a user-owned fork. See Allowing changes to a pull request branch created from a fork.
Modifying an active pull request locally
-
リポジトリ名の下にある [Pull requests] をクリックします。
![リポジトリのメイン ページのスクリーンショット。 水平ナビゲーション バーでは、[pull request] というラベルが付いたタブが濃いオレンジ色の枠線で囲まれています。](/minatozaki-https-docs.github.com/assets/cb-51156/images/help/repository/repo-tabs-pull-requests-global-nav-update.png)
-
In the list of pull requests, click the pull request you want to modify.
-
To choose where you want to open the pull request, select the Code dropdown and click one of the tabs.

メモ
GitHub CLI の詳細については、「GitHub CLI について」を参照してください。
To check out a pull request locally, use the gh pr checkout subcommand. Replace PULL-REQUEST with the number, URL, or head branch of the pull request.
gh pr checkout PULL-REQUEST
Modifying an inactive pull request locally
If a pull request’s author is unresponsive to requests or has deleted their fork, the changes proposed in that pull request can still be merged through a new pull request. However, if you want to make changes, you need to take additional steps to update the pull request.
After a pull request is opened, GitHub stores all of the changes remotely. Commits in a pull request are available in a repository even before the pull request is merged. You can fetch an open pull request and recreate it as your own.
Anyone can work with a previously opened pull request to continue working on it, test it, or open a new pull request with additional changes.
-
リポジトリ名の下にある [Pull requests] をクリックします。
![リポジトリのメイン ページのスクリーンショット。 水平ナビゲーション バーでは、[pull request] というラベルが付いたタブが濃いオレンジ色の枠線で囲まれています。](/minatozaki-https-docs.github.com/assets/cb-51156/images/help/repository/repo-tabs-pull-requests-global-nav-update.png)
-
In the Pull Requests list, click the pull request you want to merge.
-
Find the ID number of the inactive pull request. This is the sequence of digits right after the pull request's title.

-
Open your terminal or Git Bash.
-
Fetch the reference to the pull request based on its ID number. This creates a new branch. Use the pull request ID and the name of the local branch you want to create in the command.
git fetch origin pull/ID/head:BRANCH_NAME -
Switch to the new branch that's based on this pull request:
[main] $ git switch BRANCH_NAME > Switched to a new branch 'BRANCH_NAME' -
Make any needed changes to this branch. You can run local tests or merge other branches into the branch.
-
When you're ready, push the new branch:
[pull-inactive-pull-request] $ git push origin BRANCH_NAME > Counting objects: 32, done. > Delta compression using up to 8 threads. > Compressing objects: 100% (26/26), done. > Writing objects: 100% (29/29), 74.94 KiB | 0 bytes/s, done. > Total 29 (delta 8), reused 0 (delta 0) > To https://github.com/USERNAME/REPOSITORY.git > * [new branch] BRANCH_NAME -> BRANCH_NAME -
Create a new pull request with your new branch.
Error: Failed to push some refs
The remote refs/pull/ namespace is read-only. If you try to push commits there, you'll see this error:
! [remote rejected] HEAD -> refs/pull/1/head (deny updating a hidden ref)
error: failed to push some refs to 'git@github.local:USERNAME/REPOSITORY.git'
ヒント
When you remove or rename a remote reference, calls to git-remote do not affect your local refs/pull/origin/ namespace.