This guide was created for people in non-developer roles who want to start using Copilot in their day to day.
Click to expand
Now that GitHub Copilot is available in GitHub.com, you don't need to use an Integrated Developer Environment (IDE) like Visual Studio Code (VS Code) to use Copilot. However, VS Code offers some customization and functionality that you can't get in GitHub.com today.
If you don't have VS Code, you can download it here.
If you already have VS Code, make sure you update to the latest version:
- With VS Code open, click the
Code
tab at the top left - Select
Check for Updates...
- If an update is available, apply it, then restart VS Code when prompted
- In VS Code, let's create a new workspace to work through all of our exercises:
- Select
File
-->Open Folder...
- If needed, create a new folder so that you're working from a clean slate
- Select
Click to expand
- Select the
Extensions
button from the left hand navigation bar
- Search for "Copilot"
- Click the
Install
button next toGitHub Copilot
- In the Copilot panel on the right, select
Sign in to Use Copilot
- Select
Continue
next to your primary account
- Select
Continue
again
Click to expand
- To ensure Copilot is properly authenticated, type "Hello" in the Copilot Chat window and hit enter.
-
If Copilot does not respond, or if you see an error, double check that:
- You are authenticated with a GitHub account that has a Copilot license (click the
Accounts
icon at the bottom left) - You have the latest version of VS Code (click
Code
-->Check for updates...
) - You have the latest version of the Copilot Extension (click
Extensions
-->GitHub Copilot
-->Update
orRestart Extensions
) - You have restarted VS Code after applying any updates (click the
Manage
gear icon at the bottom left)
- You are authenticated with a GitHub account that has a Copilot license (click the
-
Copilot has some pre-defined shortcuts called slash commands. You can view all of the available slash commands by typing
/help
.
- Two very helpful slash commands are
/new
and/explain
./new
is great when you need to create many files or a folder structure for a new project./explain
is a quick way to have Copilot teach you more about what it generated, or to have Copilot summarize a large block of text/code.
Click to expand
Sometimes you know what you want to cover, but not how you want to present it. I find that it can be easier tweaking something vs. designing from scratch.
For example, maybe you want to create a new README for your team's repository. Here are some prompts that got me to a great outline:
Create a template markdown file to be used as the readme for my team's GitHub repository.
It should include sections for our mission, what we do, and our team's pictures and contact information.
Include examples in each section.
Update the team picture to link to CallMeGreg's github profile picture
In the team pictures section, change the pictures to a table that also includes columns for their name, handle, and email address
Adjust the size of the picture to be smaller
After just a few back and forths, I was left with this markdown content:
Which looked like this in GitHub:
Click to expand
At GitHub, I find myself writing a lot of markdown between README's, issues, and discussions. However I prefer to take notes in Google Docs, and copying/pasting between the two can be really ugly.
This is an area where Copilot can help take the burden of reformatting off your plate.
When converting something to markdown, try the following prompt:
Can you convert the following notes into markdown format?
Use bulleted lists, use formatting to bold important parts, and include emojis in titles where appropriate.
<Paste in your raw notes here>
For example, starting with a Google Doc that looks like this:
This is what a direct copy and paste into GitHub Issues looks like
And here's what it looks like after using the simple Copilot prompt from above 🤩
Click to expand
On top of helping you write and format content, Copilot can review content for typos, style, and clarity.
We can also customize what Copilot looks for in its reviews by specifying review instructions.
Navigate to the VS Code Extensions
tab and search for Copilot. Then click the Manage
gear icon next to GitHub Copilot Chat.
Scroll down to the section labeled Github › Copilot › Chat › Review Selection: Instructions
. Be sure to find "Review Selection", and not one of the other instructions sections for other things like code generation and test generation.
Click Edit in settings.json
.
If you're offered a quick selection, choose one of the options that start with "text"
, then modify the instructions to your liking. Or manually update the github.copilot.chat.reviewSelection.instructions
section to look like this:
"github.copilot.chat.reviewSelection.instructions": [
{
"text": "Look for spelling and grammar mistakes, refine for clarity, and add emojis where appropriate."
}
],
Save the settings.json
file and go back to a file that you would like to review.
Highlight all of the text that you want Copilot to review, then right click and select Copilot
--> Review and Comment
You can quickly apply or discard suggestions with the Apply
and Discard
buttons, jump between suggestions with the arrows, move a comment to that Chat window, or discard all suggestions and return to edit mode.
Click to expand
Issue templates are a great way to streamline collection of GitHub Issues in a consistent fashion.
Copilot can help elevate your issue template game by providing the boilerplate code needed for issue forms, rather than using markdown / markdown comments in your templates.
Start by prompting Copilot with a rough outline of what you want to achieve, being as specific as possible about default labels, assignees, and the form fields you want to include.
I want to create a GitHub issue template using an issue form.
The form will be used to capture feedback about our recent team offsite.
Include the default label "Offsite Feedback" and assign the issue to CallMeGreg.
The form should have fields for an overall rating 1-10, a text box for what went well, and a text box for what could be improved next time.
Also, include a required dropdown selection for which specific team the user is a part of: Engineering, Product, or Design.
Remember, Copilot might not get it exactly right the first time. Ask follow up questions to fix errors, adjust styling, add ghost text, change the order of the fields...you're the pilot!
With the prompt from above, I ended up with a new issue template that looks like this: