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
Welcome to **"Accelerate with GitHub Copilot"** exercise! :robot:
3
+
Welcome to your **"Accelerate with GitHub Copilot"** exercise! :robot:
4
4
5
-
In this exercise, you will be using different GitHub Copilot features to work on a website that allows students of Mergington High School to sign up for extracurricular activities:student:
5
+
In this exercise, you will be using different GitHub Copilot features to work on a website that allows students of Mergington High School to sign up for extracurricular activities. 🎻 ⚽️ ♟️
6
6
7
7
### What is GitHub Copilot?
8
8
9
9
GitHub Copilot is an AI coding assistant that helps you write code faster and with less effort, allowing you to focus more energy on problem solving and collaboration.
10
10
11
11
GitHub Copilot has been proven to increase developer productivity and accelerate the pace of software development. For more information, see [Research: quantifying GitHub Copilot’s impact on developer productivity and happiness in the GitHub blog.](https://github.blog/news-insights/research/research-quantifying-github-copilots-impact-on-developer-productivity-and-happiness/)
12
12
13
+
Your most common interactions will likely be:
14
+
15
+
-**Inline suggestions**: As you type, Copilot uses the nearby context to suggest code directly in your editor. This will be a familiar interaction if you have used code completion tools like [Intellisense](https://code.visualstudio.com/docs/editor/intellisense), except that the completions may be entire functions.
16
+
-**Copilot Chat**: A dedicated chat panel that lets you ask coding-related questions. This will be familiar if you have used only AI assistant chats. The big difference however, is that your files can provide automatic context for copilot to provide tailored responses.
17
+
18
+
> [!TIP]
19
+
> You can learn more about current and preview features in the [GitHub Copilot Features](https://docs.github.com/en/copilot/about-github-copilot/github-copilot-features) documentation.
20
+
21
+
> [!TIP]
22
+
> You can also select different [models](https://docs.github.com/en/github-models) and [extensions](https://github.com/features/copilot/extensions), but those are different lessons!
23
+
13
24
### How can I use GitHub Copilot?
14
25
15
-
### :keyboard: Activity: Getting to know basic Copilot features :robot:
26
+
As you work, you'll find GitHub Copilot can help out in several places across the website and in your favorite coding environments such as VS Code, Jet Brains, XCode! For today's coding though, we will practice with VS Code in a preconfigured development environment known as [Codespace](https://github.com/features/codespaces).
27
+
28
+
### :keyboard: Activity: Get a project intro from Copilot Chat :robot:
29
+
30
+
Let's start up our development environment, use copilot to learn a bit about the project, and then give it a test run.
16
31
17
32
1. Right-click the below button to open the **Create Codespace** page in a new tab. Use the default configuration.
18
33
@@ -25,49 +40,81 @@ GitHub Copilot has been proven to increase developer productivity and accelerate
25
40
26
41
1. Wait a moment for Visual Studio Code to load in your browser.
27
42
28
-
1.Click the extensions sidebartab and verify that `GitHub Copilot`extension is installed.
43
+
1.In the left sidebar, click the extensions tab and verify that the `GitHub Copilot`and `Python` extensions are installed and enabled.
<!-- Change above image to also display the python and python debugger extensions. -->
48
+
49
+
1. At the top of VS Code, locate and click the **Copilot icon** to open a Copilot Chat panel.
32
50
33
-
1. Search for the Copilot Icon on the top right section of your editor.
34
-
Open up Copilot Chat and ask Copilot to introduce you to the project.
51
+
1. Enter the below prompt to ask Copilot to introduce you to the project.
35
52
36
53
```txt
37
-
@workspace Briefly explain the structure of the codebase in this repository.
54
+
@workspace Please briefly explain the structure of this project. What should I do to run it?
38
55
```
39
56
40
-
1. Run the project by using `Run and Debug` section in the left sidebar of VS Code.
57
+
> **Tip**: No need to follow these steps. The environment is already configured.
58
+
59
+
1. Now that we know a bit more about the project, let's actually try runnning it! In the left sidebar, select the `Run and Debug` tab and then press the **Start Debuggin** icon.
1. We want to see our webpage running in a browser, so let's find the url and port. If it isn't visible, expand the the lower panel and select the **Ports** tab.
64
+
65
+
1. In the list, find port `8000` and the related link. Hover over the link and select the **Open in browser** icon.
### :keyboard: Activity: Use Copilot to help remember a terminal command :robot:
48
72
73
+
Great work! Now that you are familiar with our app, let's ask copilot for helping starting a branch so we can do some customizing.
49
74
50
-
1.Great! Now that you know what we will be working with, let's have your first interaction with Copilot.
75
+
1.If not already there, return to VS Code.
51
76
52
-
Open up a terminal a new terminal window in VS Code so you won't interrupt the debug session you just started in the current one.
77
+
1. In the bottom panel, select the **Terminal** tab. On the right side, click the plus `+` sign to create a new terminal window.
53
78
54
-
Next, `Right click` within the newly created terminal window, then click `Copilot` => `Terminal Inline Chat`.
79
+
> **Tip:** This will avoid stopping the existing debug session that is hosting our web application service.
55
80
56
-
This feature can help you with any shell commands, in our case let's ask Copilot
81
+
1. Within the new terminal window, `right click` and select `Copilot` then `Terminal Inline Chat`.
82
+
83
+
> **Pro Tip:** You can also open inline chat with the keyboard shortcut `Ctrl + I` (windows) `Cmd + I` (mac).
84
+
85
+
1. Let's ask Copilot to help us remember a command we have forgotten, creating a branch and publishing it.
57
86
58
87
```txt
59
-
Hey copilot, how can I create and publish a new git branch? The branch should be named accelerate-with-copilot
88
+
Hey copilot, how can I create and publish a new Git branch?
89
+
```
90
+
91
+
> **Tip:** This is a simple example, but Copilot is great at providing more tailored commands that might involve loops, pattern matching, file modification, and more! Don't be afraid to ask Copilot for a suggestion. Just remember it is suggestion and you should always verify it first to be safe.
92
+
93
+
1. Copilot probably gave us a command like the following. Rather than manually modify it, let's respond back to tell Copilot to use a particular name.
94
+
95
+
```bash
96
+
git checkout -b {new_branch_name}
97
+
git push -u origin {new_branch_name}
98
+
```
99
+
100
+
```text
101
+
Awesome! Thanks, Copilot! Let's use the branch name "accelerate-with-copilot".
60
102
```
61
103
62
-
Copilot will provide you with a list of commands that it thinks you should run. If something feels off, you can Ask Copilot to fix or customize the commands further and when you are ready, press `Run` and Copilot will run the commands for you in your terminal!
104
+
> **Tip:** If something is incorrect in the response, you can always continue explaining what you need. Copilot will remember the conversation history in follow-up responses.
105
+
106
+
1. Now that we are happy with the command, press the `Run` button to let Copilot run it for us. No need to copy and paste!
107
+
108
+
1. After a moment, look in the VS Code lower status bar, on the left, to see the active branch. It should now say `accelerate-with-copilot`. If so, you are all done with this step!
63
109
64
-
1.Wait a moment for the bot to check your work. You will see a comment with progress info and the next lesson.
110
+
1.Mona should already be busy checking your work. Give her a moment and keep watch of the comments. You will see her respond with progress info and the next lesson.
65
111
66
-
<details>
67
-
<summary>Having trouble? 🤷</summary><br/>
112
+
<details>
113
+
<summary>Having trouble? 🤷</summary><br/>
68
114
69
-
If you don't get feedback, here are some things to check:
115
+
If you don't get feedback, here are some things to check:
70
116
71
-
- Make sure your created the branch with the exact name `accelerate-with-copilot`. No prefixes or suffixes.
117
+
- Make sure your created the branch with the exact name `accelerate-with-copilot`. No prefixes or suffixes.
118
+
- Make sure the branch was indeed published to your repository.
0 commit comments