Important
Microsoft Copilot uses AI and might make mistakes or misinterpret instructions. Review requests and results carefully, especially before Copilot Code runs commands, connects to the internet, changes files, or before you share personal information. You're responsible for actions Copilot takes on your behalf. By using Copilot, you agree to the Terms of Use. For more information, see the Microsoft Privacy Statement.
Microsoft Copilot Code for personal accounts is currently in Preview.
This information relates to a prerelease product that may be substantially modified before it's released. Microsoft makes no warranties, expressed or implied, with respect to the information provided here.
Connect a GitHub account to work with an existing repository, ask questions about code, and create branches, commits, and pull requests. A GitHub account is optional. You can build, preview, and save projects without connecting one.
Connect your GitHub account
To connect your GitHub account, follow these steps:
- In Copilot Code, start the GitHub connection from the dropdown above the input box or when you choose to work with a repository.
- Sign in to GitHub.
- Review and approve the requested access.
Start from a repository
After you connect GitHub, choose how to open the repository:
- Local project: Connect a remote GitHub repository and create a local clone to work with on your device.
- Existing local clone (local projects): Add the folder path to a repository you already cloned. If Copilot Code doesn't find a GitHub remote, it treats the folder as a local project.
Ask about the repository
When you connect a repository, you can ask Copilot Code questions about the code in plain language, such as:
- What do I need to change to add a new field end-to-end?
- Where is the signup flow handled in this repo?
Copilot Code reads the repository to answer and can trace the files involved.
Make changes with a pull request
Ask Copilot Code to make a change in the connected repository. Copilot Code can:
- Create a branch.
- Change files and create commits.
- Push the branch to GitHub.
- Open a draft pull request with a description of the change.
Tip
In Plan mode, review the plan Copilot Code proposes before it makes changes. You can push back on a decision, and Copilot Code updates its approach before it continues.
Create a repository for a Copilot Code project
If you started without GitHub, you can create a GitHub repository later. Review the project for personal information and credentials before you publish it to GitHub.
Track your GitHub work
After you connect GitHub, select My Work in the side navigation to view:
- Your issues.
- Your active pull requests.
- Pull requests waiting for your review.
Select an item to open it and continue working.