Have Copilot repair an existing pull request
A developer used GitHub Copilot to patch a PR, but it created a separate PR instead of updating the original branch.
- What they did
- The developer opened a pull request and then followed Copilot’s own instruction to mention @copilot in a comment when they wanted changes. They asked it to fix their PR and expected the edits to land on that same branch. Instead, Copilot spun up a new pull request, which would have forced them to merge the changes back by hand.
- How it went
- GitHub later added support for Copilot to modify any pull request. Even so, Stephen Toub said it still breaks when the source branch lives in a fork, which is the case for almost all human-authored PRs in dotnet/runtime.
- Tips
- Before relying on this flow, check whether the PR branch comes from a fork. If it does, Copilot may still be unable to update it in place.
Try it yourself with GitHub Copilot
You are helping with an open pull request in [owner/repo]. Review PR #[PR number] and the issue or review comment at [link or short description]. Make the smallest safe change to address [bug, lint failure, or review request], then pause and ask me to approve before doing anything irreversible, including submitting the change if it would create a new PR instead of updating the existing one. If you can update the current branch, do that; if not, explain why, list the exact files you would change, and wait for my approval before proceeding. Stop after the fix is ready or you have explained the blocker.
Fill in the [brackets]. Agents can make mistakes, so review anything before it is sent, paid or deleted.
Get 3 agent uses like this every morning
With the day's top AI news. Free, and one click to unsubscribe.
Related agent uses
Design a PR review agent for Azure DevOps
A developer explored how to use GitHub Copilot to review pull requests for Azure DevOps repos, despite Copilot’s built-in review being limited to GitHub.
Run terminal commands carefully in Copilot agent mode
A VS Code user had Copilot agent mode run shell commands, but it often missed output or got stuck until they changed the shell setup.
Create a filtered summary page with Copilot
Copilot agent mode in Visual Studio 2022 built a charges report in a Razor Pages app, added navigation, and drafted the commit steps.
Use Copilot to draft a hard Flutter function
A developer had GitHub Copilot write a tricky Flutter function, then checked it with their own tests and harness.
Set up Copilot to review your PRs, then check for blockers
A developer used GitHub Copilot for PR reviews in a private repo, then found that a large binary file was causing the reviews to fail.
Use Copilot CLI subagents for parallel terminal work
A commenter used GitHub Copilot CLI to split repo work across multiple subagents, run commands in parallel, and review the results live.