Set Copilot to code in a branch before it pushes
A developer used GitHub Copilot to work issues, but learned to give tighter instructions after it wrote weak first PRs and pushed to the wrong place.
- What they did
- A developer assigned issues to GitHub Copilot coding agent and watched it handle the work. They found it understood the codebase well and could make sensible changes, but the first pull requests were poor when the instructions were vague. In a separate example, a commenter told the agent to push the finished work to the repository and continue without more prompts.
- How it went
- The main complaint was that the agent pushed to a branch and left main empty, then kept checking for hours and looking through empty folders. The original poster also said it could not open attachments or follow org PR links, so those had to be pasted into the issue instead.
- Tips
- Set Copilot instructions before giving it the first task, and keep the work off main until you have reviewed the branch name and plan. If a task depends on files or linked context, paste the content directly into the issue and ask for approval before any push or submit step.
Try it yourself with GitHub Copilot
In [owner/repo], help me complete [feature or issue]. First, review the issue and any pasted context, then tell me the branch name you plan to use, the files you expect to touch, and a short summary of your approach. Wait for my approval before creating or pushing anything. After I approve, make the changes on a new branch, push them, and open a pull request. Stop before any irreversible step such as pushing to the default branch, submitting, merging, deleting, or sending anything, and tell me exactly what you changed and where it was pushed.
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
Use Copilot Agent Mode on notebook edits carefully
A user tried Copilot Agent Mode on a large Jupyter notebook and had to revert repeatedly after it damaged the file mid-edit.
Use Copilot agents to ship a staff roster app
They built a Next.js staff roster app with Copilot agents, including 20 sample employees and editable records.
Use Copilot for a tightly managed coding day
A commenter had GitHub Copilot produce all the code they pushed in one day, with close supervision throughout.
Use Copilot for narrow coding tasks only
A developer first let GitHub Copilot Agent Mode handle most coding, then restricted it after losing track of their own code.
Use Copilot to draft tests and check CI automatically
They let GitHub Copilot create tests and added automated checks in GitHub Actions, which reduced CI failures and sped up merges.
Let Copilot generate tests and keep rerunning them
A commenter configured GitHub Copilot to keep executing tests and fixing failures until they passed, with a human approving each terminal step.