You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description: Use GitHub Copilot Edits to iterate quickly on code changes across multiple files in Visual Studio version 17.13 and later.
4
4
ms.date: 7/31/2025
5
5
ms.update-cycle: 180-days
@@ -13,91 +13,94 @@ monikerRange: '>= vs-2022'
13
13
---
14
14
# What is GitHub Copilot Edits?
15
15
16
-
GitHub Copilot Edits, a feature of GitHub Copilot Chat, is designed to help iterating across multiple files more efficient. This feature is available with the release of Visual Studio 2022 version 17.13.
16
+
GitHub Copilot Edits, a feature of GitHub Copilot Chat, is designed to help you iterate across multiple files more efficiently. This feature is available with the release of Visual Studio 2022 version 17.13.
17
+
18
+
Copilot Edits combines the conversational flow of chat and an inline review experience. It offers the following benefits:
17
19
18
-
Edits combines the conversational flow of chat and an inline review experience, offering the following benefits:
19
20
-**Preview with clarity**: Know exactly what's being modified with a summary of the affected files and the proposed changes.
20
-
-**Review with flow**: View code diffs inline, directly in your editor. Use the `TAB` key to accept or the `Alt+Del` key to reject individual changes, or apply/dismiss all at once.
21
-
-**Iterate with confidence**: Use checkpoints to revisit earlier iterations of a code file or try an alternative approach anytime for new ideas.
21
+
-**Review with flow**: View code diffs inline, directly in your editor. Use the <kbd>Tab</kbd> key to accept or <kbd>Alt</kbd>+<kbd>Delete</kbd> to reject individual changes, or apply/dismiss all at once.
22
+
-**Iterate with confidence**: Use checkpoints to revisit earlier iterations of a code file, or try an alternative approach anytime for new ideas.
22
23
23
24
## Prerequisites
24
-
+[Visual Studio 2022 version 17.13](/visualstudio/releases/2022/release-history) and later offer Copilot Edits.
25
-
+[Sign in to Visual Studio using a GitHub account](work-with-github-accounts.md) with [Copilot access](https://docs.github.com/en/copilot/about-github-copilot/what-is-github-copilot#getting-access-to-copilot). <br/>
26
-
+ You can use [GitHub Copilot for Free](copilot-free-plan.md). Sign up and leverage AI to code faster and more efficiently.
27
25
28
-
## When to use Copilot Edits vs. Copilot Chat
26
+
- Install [Visual Studio 2022 version 17.13](/visualstudio/releases/2022/release-history) or later.
27
+
-[Sign in to Visual Studio by using a GitHub account](work-with-github-accounts.md) with [Copilot access](https://docs.github.com/en/copilot/about-github-copilot/what-is-github-copilot#getting-access-to-copilot).
29
28
29
+
You can use [GitHub Copilot for free](copilot-free-plan.md). Sign up and use AI to code faster and more efficiently.
30
+
31
+
## When to use Copilot Edits vs. Copilot Chat
30
32
31
33
| Functionality | Copilot Chat | Copilot Edits |
32
34
| ------------- | ------------- | ------------- |
33
-
| Primary use case |**Generalpurpose** conversational interface for understanding programming concepts, asking questions about code, and generating code. |**Focused multi-file editing** interface with code review, in-file preview, and rollback experience to make iterating on code across multiple files easier. |
34
-
| Previewing proposed code |**Manually apply** each code block to each file in your solution to evaluate code-diff. |**Automatically applies**proposed code diff in each code file, making comprehension of the proposed changes easier.|
35
-
| Code review experience | Accept or reject a **file worth of changes** at once. | Accept or reject **individual chunks of code** within a file. |
36
-
| Versioning | Can use existing version control. | Adds a **rollback experience** to reset edited files to a previous state. Tracks all changes - proposed, accepted, dismissed, and manual edits made to the file. These checkpoints are retained until the user closes Visual Studio. |
35
+
| Primary use case | General-purpose conversational interface for understanding programming concepts, asking questions about code, and generating code. | Focused multiple-file editing interface with code review, in-file preview, and rollback experience to make iterating on code across multiple files easier. |
36
+
| Previewing proposed code | Manually apply each code block to each file in your solution to evaluate a codediff. | Automatically apply a proposed code diff in each code file, which makes comprehension of the proposed changes easier.|
37
+
| Code review experience | Accept or reject a file's worth of changes at once. | Accept or reject individual chunks of code within a file. |
38
+
| Versioning | Can use existing version control. | Adds a rollback experience to reset edited files to a previous state. Tracks all changes (proposed, accepted, dismissed, and manual edits) made to the file. These checkpoints remain until you close Visual Studio. |
37
39
38
-
## Using Copilot Edits
40
+
## Activities in Copilot Edits
39
41
40
-
### Start an Edits thread
42
+
### Start a Copilot Edits thread
41
43
42
-
:::image type="content" source="media/vs-2022/copilot-edits/getting-started-with-edits.gif" alt-text="Animated screenshot that shows starting a Copilot Edits thread and getting a response." lightbox="media/vs-2022/copilot-edits/getting-started-with-edits.gif":::
44
+
1. Select **View** > **GitHub Copilot Chat** to open GitHub Copilot Chat. You can also open it from the GitHub Copilot status icon.
43
45
44
-
1. Select **View** > **GitHub Copilot Chat** to launch GitHub Copilot Chat. You can also launch it from the GitHub Copilot status icon.
45
-
2. Select **Create new Edit session** to create a new Edits thread.
46
-
3. Enter a chat prompt using natural language about the specific edit you want to make. To help Copilot Edits provide better code suggestions, you can also add relevant context to your prompt. [Reference context](copilot-chat-context-references.md#reference-context) by typing the `#` commands to refer to a file, your solution, errors, or a symbol specifically or [attach images](copilot-chat-context-references.md#attach-images) to provide additional context.
46
+
2. Select **Create new Edit session**.
47
+
48
+
3. Enter a chat prompt, by using natural language, about the specific edit that you want to make.
49
+
50
+
To help Copilot Edits provide better code suggestions, you can also add relevant context to your prompt. [Reference context](copilot-chat-context-references.md) by typing the `#` commands to refer to a file, your solution, errors, or a symbol specifically. Or [attach images](copilot-chat-context-references.md#attach-images) to provide additional context.
51
+
52
+
:::image type="content" source="media/vs-2022/copilot-edits/getting-started-with-edits.gif" alt-text="Animated screenshot that shows starting a Copilot Edits thread and getting a response." lightbox="media/vs-2022/copilot-edits/getting-started-with-edits.gif":::
47
53
48
54
> [!TIP]
49
-
> We suggest you ask for one commit’s worth of changes at a time. The more you can break down a problem, the better the result.
55
+
> We suggest that you ask for one commit's worth of changes at a time. The more you can break down a problem, the better the result.
50
56
51
57
### Accept or discard edits
52
58
53
-
After Copilot Edits proposes a code iteration, you can preview these suggestions in your code files. You can then **Accept** to commit the proposed changes.
59
+
After Copilot Edits proposes a code iteration, you can preview these suggestions in your code files. You can then accept the proposed changes to commit them.
54
60
55
61
#### Review each proposed change
56
62
57
-
:::image type="content" source="media/vs-2022/copilot-edits/accept-by-chunk.gif" alt-text="Animated screenshot that shows applying edits to file and accepting by chunk." lightbox="media/vs-2022/copilot-edits/accept-by-chunk.gif":::
63
+
1. Select a file name. The file opens, and proposed changes appear as a diff in the code editor.
58
64
59
-
+ Start by clicking on a filename.
60
-
+ The file opens and proposed changes are displayed as a diff in the code editor.
65
+
1. Use the <kbd>Tab</kbd> key to accept a proposal, <kbd>Alt</kbd>+<kbd>Delete</kbd> to reject a proposal, or <kbd>F8</kbd> to go to the next proposal.
61
66
62
-
+ Use `TAB` to accept a proposal, `Alt+Del` to reject a proposal, or `F8` to go to the next proposal.
67
+
If you accept or reject a proposal, the cursor automatically moves to the next proposal.
63
68
64
-
+ If you accept or reject a proposal, the cursor will automatically move to the next proposal.
69
+
:::image type="content" source="media/vs-2022/copilot-edits/accept-by-chunk.gif" alt-text="Animated screenshot that shows applying edits to a file and accepting by chunk." lightbox="media/vs-2022/copilot-edits/accept-by-chunk.gif":::
65
70
66
71
#### Accept all proposed changes in a file
67
72
68
-
:::image type="content" source="media/vs-2022/copilot-edits/accept-file.gif" alt-text="Animated screenshot that shows accepting edits to a specific file." lightbox="media/vs-2022/copilot-edits/accept-file.gif":::
69
-
73
+
Select the checkbox next to a file name to accept all proposed changes that are specific to a file.
70
74
71
-
Click the checkbox next to a filename to accept all proposed changes specific to a file.
75
+
:::image type="content" source="media/vs-2022/copilot-edits/accept-file.gif" alt-text="Animated screenshot that shows accepting edits to a specific file." lightbox="media/vs-2022/copilot-edits/accept-file.gif":::
72
76
73
77
#### Accept all proposed changes in all files
74
78
75
-
:::image type="content" source="media/vs-2022/copilot-edits/accept-all.gif" alt-text="Animated screenshot that shows accepting all edits on all files." lightbox="media/vs-2022/copilot-edits/accept-all.gif":::
79
+
Select **Accept all** to accept the proposed code changes across all files where changes are available. Files that have proposed changes are bold.
76
80
77
-
Select **Accept all** to accept the proposed code changes across all files where changes are available. Files with proposed changes are bolded.
81
+
:::image type="content" source="media/vs-2022/copilot-edits/accept-all.gif" alt-text="Animated screenshot that shows accepting all edits on all files." lightbox="media/vs-2022/copilot-edits/accept-all.gif":::
78
82
79
83
### Revert edits
80
84
81
85
#### Revert to the original state
82
86
83
-
:::image type="content" source="media/vs-2022/copilot-edits/reset-iteration.png" alt-text="Screenshot that shows reverting file tothe original state before any edits." lightbox="media/vs-2022/copilot-edits/reset-iteration.png":::
87
+
While you review file changes, you might accept or reject a code proposal that you didn't mean to. If so, select **Reset changes** to reset the listed files to their state before the iteration was generated.
84
88
85
-
While reviewing file changes, if you accept or reject a code proposal you didn't mean to, select **Reset changes** to reset the listed files to their state before the iteration was generated.
89
+
:::image type="content" source="media/vs-2022/copilot-edits/reset-iteration.png" alt-text="Screenshot that shows reverting a file to the original state, before any edits." lightbox="media/vs-2022/copilot-edits/reset-iteration.png":::
86
90
87
-
Reset changes also resets any manual changes made to the files.
88
-
A popup dialog confirms the action before reverting file states
91
+
**Reset changes** also resets any manual changes that you made to the files.
92
+
A popup dialog confirms the action before reverting the file states.
89
93
90
94
### Revert to a previous iteration
91
95
92
-
:::image type="content" source="media/vs-2022/copilot-edits/reset-to-previous-iteration.png" alt-text="Screenshot that shows reverting file to a previous iteration." lightbox="media/vs-2022/copilot-edits/reset-to-previous-iteration.png":::
93
-
94
-
95
-
At any time, you can select the **Reset to Iteration** on a previous iteration to reset all proposed and manual changes made to the listed files.
96
+
At any time, you can select **Reset to Iteration** on a previous iteration to reset all proposed and manual changes made to the listed files.
96
97
A popup dialog confirms the action before reverting file states.
97
98
99
+
:::image type="content" source="media/vs-2022/copilot-edits/reset-to-previous-iteration.png" alt-text="Screenshot that shows reverting a file to a previous iteration." lightbox="media/vs-2022/copilot-edits/reset-to-previous-iteration.png":::
100
+
98
101
## Related content
99
102
100
103
-[Install and manage GitHub Copilot in Visual Studio](visual-studio-github-copilot-install-and-states.md)
101
104
-[GitHub Copilot experience for Visual Studio](visual-studio-github-copilot-extension.md)
102
105
-[GitHub Copilot Chat experience for Visual Studio](visual-studio-github-copilot-chat.md)
0 commit comments