Skip to content

Commit 6b987b3

Browse files
committed
Add Copilot to Source Control docs
1 parent d326409 commit 6b987b3

File tree

6 files changed

+132
-56
lines changed

6 files changed

+132
-56
lines changed

docs/sourcecontrol/github.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ The queries used to display pull requests can be configured with the **GitHub Pu
9696
},
9797
```
9898

99-
### Creating Pull Requests
99+
### Creating pull requests
100100

101101
Once you have committed changes to your fork or branch, you can use the **GitHub Pull Requests: Create Pull Request** command or the **Create Pull Request** button in the **Pull Requests** view to create a pull request.
102102

@@ -114,6 +114,11 @@ Once you select **Create**, if you have not already pushed your branch to a GitH
114114

115115
The **Create Pull Request** view now enters **Review Mode**, where you can review the details of the PR, add comments, and merge the PR once it's ready. After the PR is merged, you'll have the option to delete both the remote and local branch.
116116

117+
> [!TIP]
118+
> Use GitHub Copilot to generate a PR title and description, based on the commits that are included in the PR. Select the _sparkle_ icon next to the PR title field to generate a PR title and description.
119+
120+
![Screenshot that shows the Generate Commit Message with Copilot button in the commit message input box.](images/overview/copilot-generate-commit-message.png)
121+
117122
### Reviewing
118123

119124
Pull requests can be reviewed from the **Pull Requests** view. You can assign reviewers and labels, add comments, approve, close, and merge all from the pull request **Description**.
@@ -128,6 +133,9 @@ The diff editors from this view use the local file, so file navigation, IntelliS
128133

129134
When you are done reviewing the pull request changes you can merge the PR or select **Exit Review Mode** to go back to the previous branch you were working on.
130135

136+
> [!TIP]
137+
> You can also [let Copilot perform a code review of the PR](https://docs.github.com/en/copilot/using-github-copilot/code-review/using-copilot-code-review?tool=vscode) before you create it. Select the **Copilot Code Review** button in the GitHub Pull Request view.
138+
131139
## Issues
132140

133141
### Creating issues
@@ -247,12 +255,6 @@ These changes are deleted from our service once they are applied to your target
247255

248256
In the event that your pending changes are not automatically applied to your target development environment, you can view, manage, and delete your stored changes using the **Cloud Changes: Show Cloud Changes** command.
249257

250-
## GitHub Copilot
251-
252-
In VS Code, you can enhance your coding with artificial intelligence (AI), such as suggestions for lines of code or entire functions, fast documentation creation, and help creating code-related artifacts like tests.
253-
254-
[GitHub Copilot](https://copilot.github.com/) is an AI-powered code completion tool that helps you write code faster and smarter. You can use the [GitHub Copilot extension](https://marketplace.visualstudio.com/items?itemName=GitHub.copilot) in VS Code to generate code, or to learn from the code it generates.
255-
256-
[![GitHub Copilot extension in the VS Code Marketplace](images/github/copilot-extension.png)](https://marketplace.visualstudio.com/items?itemName=GitHub.copilot)
258+
## Next steps
257259

258-
You can learn more about how to get started with Copilot in the [Copilot documentation](/docs/editor/github-copilot.md).
260+
* Learn more about [Copilot VS Code](/docs/copilot/overview.md) - Learn about Copilot in VS Code.
Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 3 additions & 0 deletions
Loading

docs/sourcecontrol/intro-to-git.md

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ MetaDescription: Get started with Git in Visual Studio Code and take control of
1111

1212
Want to easily manage your source code and collaborate with others? Git and GitHub are the tools you need! And with Visual Studio Code, you can set up and use them in a snap. Even if you're a beginner, VS Code's user-friendly interface guides you through common Git actions like pushing and pulling code, creating and merging branches, and committing code changes. And if you're a pro, you'll love the ability to perform Git actions directly within the editor, saving you time and effort compared to using the Git command line. Plus, the seamless workflow between VS Code and Git means you can stay in your editor and get more done.
1313

14+
With GitHub Copilot in VS Code, you can get suggestions for commit messages, pull requests, and review code changes before committing them. Learn more about [GitHub Copilot in VS Code](/docs/copilot/overview.md).
15+
16+
> [!TIP]
17+
> If you don't have a Copilot subscription yet, use Copilot for free by signing up for the [Copilot Free plan](https://github.com/github-copilot/signup). You'll get a monthly limit of completions and chat interactions.
18+
1419
## Set up Git in VS Code
1520

1621
To use Git and GitHub in VS Code, first make sure you [have Git installed on your computer](https://git-scm.com/downloads). If Git is missing, the **Source Control** view shows instructions on how to install it. Make sure to restart VS Code afterwards.
@@ -95,13 +100,15 @@ VS Code's remote repository support allows you to browse and edit a GitHub repos
95100

96101
![Remote Repositories opening a remote GitHub repo, pull request or Azure repo](images/intro/remote-repo.png)
97102

98-
> **Tip:** If you need to execute code or run terminal commands, you can seamlessly switch from a remote repository to a codespace with the command **Continue Working on**.
103+
> [!TIP]
104+
> If you need to execute code or run terminal commands, you can seamlessly switch from a remote repository to a codespace with the command **Continue Working on**.
99105
100106
## Staging and committing code changes
101107

102108
Once you have a Git repository set up, you can start tracking code changes by [staging and committing](https://git-scm.com/about/staging-area) your newly created and edited code.
103109

104-
> **Tip**: Commit your changes early and often. This makes it easier to revert back to previous versions of your code if needed.
110+
> [!TIP]
111+
> Commit your changes early and often. This makes it easier to revert back to previous versions of your code if needed.
105112
106113
You can access the **Source Control** view from the Activity Bar to list all changed files in your workspace. You can toggle between a tree view or list view by using the tree/list icon in the Source Control view header.
107114

@@ -123,7 +130,8 @@ Staged changes can also be discarded by selecting the **−** (minus) icon next
123130

124131
To commit your staged changes, type a commit message in the upper text box, and then select the **Commit** button. This saves your changes to the local Git repository, allowing you to revert to previous versions of your code if needed.
125132

126-
> **Tip**: If you have a GitHub Copilot subscription, and installed the Github Copilot extension, you can use the *sparkle* icon to [generate a commit message](/docs/copilot/overview.md#productivity-improvements).
133+
> [!TIP]
134+
> With GitHub Copilot in VS Code, you can [generate a commit message](/docs/copilot/overview.md#productivity-improvements) based on your code changes. Learn more about [generating commit messages with AI](/docs/sourcecontrol/overview.md#generate-a-commit-message-with-ai). Before you commit your changes, you can also let Copilot do a [code review of the uncommitted changes](/docs/sourcecontrol/overview.md#review-uncommitted-code-changes-with-ai).
127135
128136
You can navigate through and review all local file changes and commits in the **Timeline** view available in the bottom of the Explorer view.
129137

@@ -135,7 +143,8 @@ Once you have made commits to your local Git repository, you can push them to th
135143

136144
![Sync button with one change to push](images/intro/sync.png)
137145

138-
> **Tip:** You can enable the **Git: Autofetch** [setting](/docs/getstarted/settings.md) to always get an up-to-date remote commit indicator.
146+
> [!TIP]
147+
> You can enable the **Git: Autofetch** [setting](/docs/getstarted/settings.md) to always get an up-to-date remote commit indicator.
139148
140149
Push and pull can also be performed individually by using their respective commands. You can access these commands from the Source Control menu.
141150

@@ -153,7 +162,8 @@ To create a new branch, select the branch indicator and choose to create it from
153162

154163
![Create branch quick prompt that shows when selecting the branch indicator](images/intro/scm-create-branch.png)
155164

156-
> **Tip:** If you use the [GitHub Pull Requests and Issues](https://marketplace.visualstudio.com/items?itemName=GitHub.vscode-pull-request-github) extension, you can create a branch directly from an issue, which gets you started working in a new local branch and automatically prefills the pull request for you.
165+
> [!TIP]
166+
> If you use the [GitHub Pull Requests and Issues](https://marketplace.visualstudio.com/items?itemName=GitHub.vscode-pull-request-github) extension, you can create a branch directly from an issue, which gets you started working in a new local branch and automatically prefills the pull request for you.
157167
158168
After you create a local branch, you can push the branch to the remote repository by selecting **Publish Branch** in the **Source Control** view. This creates a new branch on the remote repository, allowing you to collaborate with others in that branch.
159169

@@ -167,7 +177,8 @@ To create a PR, make sure you are on a separate branch from the main branch, and
167177

168178
![Source Control view, highlighting the 'Create pull request' button](images/intro/scm-create-pull-request.png)
169179

170-
To review a PR, select the **Review Pull Request** button in the **Source Control** view, and select the PR you want to review. This opens the PR in a new editor window, where you can review the code changes and leave comments. Once you are satisfied with the code changes, you can select the **Merge** button to merge the PR into the targeted branch.
180+
> [!TIP]
181+
> Use GitHub Copilot to generate a PR title and description, based on the commits that are included in the PR. Select the _sparkle_ icon next to the PR title field to generate a PR title and description. You can also [let Copilot perform a code review of the PR]() before you create it. Select the **Copilot Code Review** button in the GitHub Pull Request view.
171182
172183
Learn more about pull requests in [VS Code's GitHub documentation](/docs/sourcecontrol/github.md).
173184

0 commit comments

Comments
 (0)