Intro to GitHub Copilot in Visual Studio (2025 Edition)

Brief Summary

This video introduces GitHub Copilot and its features within Visual Studio, including setup, code completion, commit message generation, AI-powered code editing, multi-model support (GPT-40 and Claude), and slash commands for code optimization. It emphasizes the tool's ability to assist in understanding codebases, writing code, and improving code quality, while also highlighting the importance of developer oversight.

  • Setting up GitHub Copilot in Visual Studio is straightforward, involving signing in with a GitHub account and enabling the free tier.
  • GitHub Copilot Chat can provide summaries of codebases and answer questions about specific features or the entire workspace.
  • Code completion and suggestions are available, but developers should ensure code quality and performance.
  • GitHub Copilot Edits facilitates changes across multiple files, allowing developers to review and accept or reject suggested changes.
  • Users can switch between different models like GPT-40 and Claude for different tasks.
  • Slash commands like /optimize can analyze and improve code, with options to preview and accept changes.

Introduction

The video introduces GitHub Copilot, highlighting its AI-powered productivity features and the availability of a free tier. It encourages viewers to subscribe for more in-depth videos and to check the description for useful links. The video aims to guide users through setting up Copilot and utilizing its various functionalities within Visual Studio.

Set up GitHub Copilot in Visual Studio

The initial step involves signing in with a GitHub account and activating the free tier of GitHub Copilot directly within Visual Studio. By clicking the "Sign up for Copilot free" button, users are redirected to GitHub for authorization. Once authorized, Visual Studio is ready to use both GitHub Copilot chat and the standard GitHub Copilot features.

Code completions & suggestions

GitHub Copilot can assist in writing code by providing suggestions and autocompletions. For example, when creating a new Azure Function, Copilot can predict the function name and suggest the rest of the code based on the context. While Copilot is helpful, developers must ensure code quality and performance. The video demonstrates how to use Copilot to fix errors by providing additional information and accepting its suggestions.

Commit messages with GitHub Copilot

GitHub Copilot can draft commit messages based on the changes made in a project. By clicking the pencil icon in the Git Changes window, Copilot generates a summary of the changes, which can be accepted or customized. This feature also supports pull requests, and users can configure Copilot to include emojis in commit messages.

GitHub Copilot Edits: AI-powered code editing sessions

GitHub Copilot Edits facilitates making changes across multiple files. By creating a new edit session in GitHub Copilot Chat, users can select a template, such as adding a new feature. The video demonstrates adding a "get definitions by author" functionality, which requires changes in both the dictionary functions and repository files. Copilot suggests changes in multiple files, and developers can review and accept or reject these changes individually or all at once.

Multi-model support

GitHub Copilot allows users to select different models like Claude 3.5 Sonet for various tasks. This feature can be enabled in the github.com settings under Copilot policies. Within Visual Studio, users can choose between GPT-40 and Claude for GitHub Copilot free. Upgrading provides access to more models. The selected model can be switched both in the chat interface and in-line in the editor.

Slash commands to optimize code

Slash commands are a feature that helps with different coding tasks. For example, the /optimize command analyzes and improves the running time of selected code. Copilot provides an optimized version with details on complexity, readability, and performance impact. Users can preview the changes before accepting them. The video recommends exploring other slash commands for their specific functionalities.

Summarize any YouTube video in seconds

Get summaries like this one for any video, in your language, with the free Summ app.

Download on the Apple Store
Get it on Google Play

Transcript

Full transcript of “Intro to GitHub Copilot in Visual Studio (2025 Edition)”. Click a timestamp to open the video at that moment. Need another video? Use the YouTube transcript generator.

0:04 there's no better time than right now to get started with GitHub co-pilot it has a ton of AI productivity packed right into it and there's a free tier now so this video is going to get to set up with everything you need to get started with co-pilot and make sure you subscribe to the visual studio YouTube channel because we're going to have plenty more videos covering everything that we cover in this one but more in depth also be sure to check out the links that we have for you in the description all right let's get started first we need to sign in with our GitHub account and enable our free tier of GitHub co-pilot we can do this with just a couple of clicks inside of Visual Studio click the sign up for co-pilot free button sign in with our GitHub

0:50 account click the signin button now we can select the continue next to the account we want to use and then authorized GitHub this will redirect us to visual studio once back in Visual Studio we're ready to use GitHub co-pilot chat and GitHub co-pilot so let's get started let's say you want to get up to speed on a new project or feature that your colleague has implemented GitHub co-pilot chat can help us do just that now when you ask gith help co-pilot chat questions by default it's going to include the active document for context however since I want to know more about the entire code base I can use the at symbol and then select workspace because we want to ask about

1:36 the entire workspace so let me complete the question by asking what does this code base do at the top we can see that copilot has generated a summary this code base appears to be part of a cloud-based dictionary application that uses Azure functions in Azure Cosmos CB and it lists out the Azure functions repositories models and tests one of my favorite functionalities in GitHub co-pilot chat is this right here at the bottom it'll provide an additional question that you can simply click on and this is related to that original question that you asked it almost nudges you to dive just a little deeper and gain a little deeper understanding so

2:21 I'm going to go ahead and click that and this case it autop populates that question which is what are the key dependencies used in this code base and it goes ahead and lists the answer there GitHub co-pilot chat and the atw workpace functionality are great tools for you to get up to speed with all things about your code base features and project overall let's now use GitHub co-pilot to write some code I've got a couple of azure functions here all of them are using HTTP triggers I've got some implementing get calls post and put but I don't have any delete so let's work on that functionality here let's go to a new line here first up we need to write the function name and in this case copad

3:08 is making an educated guess based off the file that I'm actively working on this function named delete definition I can accept by hitting tab because that is the name that I want to use let's hit enter so we can continue writing the rest of the functionality that's awesome it looks like based off the name it's been able to suggest the rest of the functionality for this delete definition Azure functions code I'm going to hit tab to accept this as well and let's continue working through this now I do see an error here so let me take a moment to remind everyone that yes co-pilot is awesome at suggestion code however it's still on us the developers to ensure quality and performance and everything

3:54 we ship which is a good thing right okay so let's hover over this eror to get a little a bit more information about what's going on all right it looks like the type cannot be inferred I'm assuming that's based off the fact that we're using null here so what I can do is hover over once more select fix with co-pilot and let's see what co-pilot suggests okay looks like it's got a suggestion here for us however I'm going to give it additional information as to how I would want to resolve this all right let's send that to co-pilot and the suggestion that it provides with the additional information I gave it looks like what I want so I'm going to hit

4:40 accept and there we go and this is just a small example of how you can leverage GitHub co-pilot to iterate back and forth and continue building awesome code when we're developing we could be making changes to a single file or multiple files and it could become difficult to remember everything that we've done let's head over to get changes click on this pencil icon and we can have co- pilot draft a commit message based off our changes we'll hit save here and let copal do its thing this summary of my changes actually works quite well for me so I can go ahead and click the accept button you can fully customize all of this to your liking let's say you want co-pilot to use emojis in your commit messages you can set that up all of this also works

5:25 for pull requests be sure to check out the docs in the description for more info so far we've used GitHub copilot to make changes to a single file but what if we need to add functionality that will require changes across multiple files well this is exactly what GitHub co-pilot edits can help us do inside of GitHub copilot chat on the top right we can select the middle icon which will allow us to create a new edit session and here we see a couple of examples of functionality that GitHub co-pilot edits can help us with we have add a new feature to my application refactor code or fix a bug and these are sort of like templates so let's select that first one here it's saying help me

6:13 add a new feature too and let's say we want to add a get definitions by author functionality here so let's continue using this template help me add a new feature to I know we're going to you need uh to implement some changes inside of dictionary functions and we also need to implement some changes into the repository file if you use the pound symbol that will allow you to reference the file and include it in the context so help me add a new feature to dictionary functions and definitions repository that gets definitions by author let's hit enter and let GitHub

7:00 co-pilot do its thing we can see here that co-pilot edits has suggested we Implement a couple of changes in a couple of files we can see them listed here so let's kick things off by selecting that first file see the changes that copilot has suggested we'll scroll to the change and once we arrive there we can hit tab to accept alt delete to reject and f8 to go to the next change I can additionally click on the right icon to accept changes in that specific file or I can accept all the changes from this top icon before I make any changes or accept

7:45 anything I can further take a look at the code and look at the other changes that co-pilot has suggested as well we select the second file scroll down and look at the changes here and from here we can hit accept all that is just a brief example of how we can make edits and implementations across multiple files with the help of copilot edits we know developers like using different models for different tasks so for co-pilot for free inside of your github.com settings on the left side you're going to select co-pilot and under co-pilot policies there's a feature that you can enable so you can leverage claw 3.5 Sonet in Co pilot just make sure you set that to enable and now

8:32 we're going to be able to use this inside of a visual studio GitHub co-pilot back inside a visual studio inside of GitHub co-pilot chat at the bottom we now have the option to select Claude as a model we want to use GPT 40 and Cloud are the options for GitHub co-pilot free and when you upgrade you'll get access to more models so keep that in mind now we also get access to selecting CL when we use co-pilot in line in the editor so let's say I select this line of code here and then I invoke co-pilot with alt forward slash you see I have access to switching the model here all right time to show you one of my favorite things with co-pilot uh these are called slash

9:18 commands so we have for example doc which adds documentation uh for uh the code that we've selected we also have tests we have optimize let's use the optimize one says analyze and improve running time of the selected code and we will hit enter here so we'll see what co-pilot and Sonet come up for us to improve this line of code here here's the optimized version of the selected code reduces complexity improves readability performance impact it's minimal but is more CPU friendly so from here I can hit preview to just look at the changes and then I can hit accept I highly recommend you

10:03 check out all of these slash commands as they all have their different functionalities and meant to help you with different tasks with your code and that's it for this video but there is so much more to GitHub co- pilot so make sure you subscribe so you can catch all the Deep Dives that we do as soon as they come out be sure to check out all the resources that we have for you in the description and of course any comments any feedback that you have you know where to leave them as always happy coding and I'll see you in the next video

Share

More video summaries