GitHub Copilot

GitHub Copilot is a great tool for using advance AI using Visual Studio Code. Copilot is powered by the most advanced AI models. Students can get access to GitHub Copilot for free through GitHub Education. Copilot can help you write code, comments, and documentation. It wrote that last sentence as I typed this introductory paragraph.

Get Access

  • Create a GitHub account.
    • You can have multiple email addresses associated with one account.
    • Make sure your university email address is one of the emails associated with the account.
  • Sign up for GitHub Education.
    • You may have to scan your student ID with your webcam or otherwise validate your student status.

It may take up to 24 hours to get access to GitHub Copilot after completing the above steps. Even if your GitHub Education status is approved, it may take time for GitHub to enable Copilot.

Visual Studio Code

Visual Studio Code does not require you to log in to edit code. However, logging in lets you synchronize your settings across installations. I strongly recommend logging in.

  • Start Visual Studio Code.
  • Click the profile icon.
  • Sign in with your GitHub account.

GitHub Copilot Extensions

  • Start Visual Studio Code.
  • Open the extensions.
  • Install GitHub Copilot. If the GitHub Copilot Chat was not installed automatically, install it.

Use GitHub Copilot Chat

  • Once GitHub Copilot Chat is enabled, you will see at chat icon in Visual Studio Code.
  • You can ask questions like you would to ChatGPT.
    • "What is network address translation?"
  • You can also ask Copilot to make suggestions to your code.
    • "Why does my program crash on line 23?"
    • "How can I improve my code?"
  • You can insert code snippets from Copilot Chat into your code.

Use GitHub Copilot

GitHub Copilot runs in the background and monitors the text you type. You may need to enable Copilot completions to get suggestions as you write code or text.

  • Click on the Copilot icon and enable (or disable) completions.
  • Copilot will suggest code or text completions as you type.
  • You can write comments, and Copilot will suggest code to implement the comments.
    • "# This function should return the sum of two numbers."

Cautions

  • Do not use Copilot if use of AI is prohibited by university of company policy.
  • Copilot may suggest code that has security vulnerabilities or bugs.
  • Validate all code that Copilot suggests.