Guide to install VS Code and set it up with GitHub Copilot:


Step 1: Install Visual Studio Code (VS Code)

  1. Download VS Code:
  2. Install VS Code:
    • Windows: Run the .exe installer and follow the on-screen instructions.
    • macOS: Open the downloaded .dmg file and drag the VS Code icon to the Applications folder.
    • Linux: Follow the installation instructions for your distribution. For Ubuntu, you can run: sudo apt update sudo apt install code

Step 2: Install Git

You need Git installed to manage repositories and integrate with GitHub.

  1. Download Git:
  2. Install Git:
    • Follow the installation steps. When prompted, use the recommended settings.
    • Configure Git with your username and email: git config --global user.name "Your Name" git config --global user.email "youremail@example.com"
  3. Verify Installation:
    • Open a terminal or command prompt and type: git --version
    • Ensure it outputs the Git version.

Step 3: Set Up GitHub Account

  1. Create a GitHub Account (if you don’t have one):
  2. Generate a Personal Access Token (optional for advanced use):
    • Navigate to Settings > Developer settings > Personal access tokens.
    • Generate a token with the necessary permissions if needed for private repositories.

Step 4: Install GitHub Copilot

  1. Install the GitHub Copilot Extension:
    • Open VS Code.
    • Go to the Extensions view by clicking on the Extensions icon in the Activity Bar on the side or pressing Ctrl+Shift+X (Cmd+Shift+X on macOS).
    • Search for “GitHub Copilot” in the Extensions Marketplace.
    • Click “Install” on the GitHub Copilot extension.
  2. Sign In to GitHub:
    • After installation, VS Code will prompt you to sign in to GitHub.
    • Click “Sign In” and follow the authorization process.
  3. Enable GitHub Copilot:
    • Once signed in, GitHub Copilot will be enabled. You can test it by opening a file and starting to write code.

Step 5: Configure GitHub Copilot

  1. Adjust Settings (Optional):
    • Go to File > Preferences > Settings (Cmd+, on macOS).
    • Search for “Copilot” and adjust the settings as desired (e.g., enable or disable inline suggestions).

Step 6: Test GitHub Copilot

  1. Open a New File:
    • Create a new file with a relevant programming language extension (e.g., .py for Python, .js for JavaScript).
  2. Write a Comment or Start Code:
    • Begin typing a comment or some code. GitHub Copilot will suggest completions.
  3. Accept Suggestions:
    • Press Tab to accept a suggestion or Esc to dismiss it.

Step 7: Additional Tips

  • Use Copilot Effectively:
    • Write descriptive comments to guide Copilot in generating the right code.
    • Review and test all code generated by Copilot for accuracy and security.
  • Keyboard Shortcuts:
    • Trigger Copilot suggestions manually with Ctrl+Space.
  • Practice with GitHub:
    • Create and clone repositories to practice using Git and GitHub in VS Code.

This guide provides all the essentials for setting up VS Code and GitHub Copilot, making it easy for students to start coding efficiently!

Scroll to Top