Step 1: Install Visual Studio Code (VS Code)
- Download VS Code:
- Visit VS Code’s official website.
- Click the download button for your operating system (Windows, macOS, or Linux).
- Install VS Code:
- Windows: Run the
.exeinstaller and follow the on-screen instructions. - macOS: Open the downloaded
.dmgfile 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
- Windows: Run the
Step 2: Install Git
You need Git installed to manage repositories and integrate with GitHub.
- Download Git:
- Visit Git’s official website and download the installer for your OS.
- 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"
- Verify Installation:
- Open a terminal or command prompt and type:
git --version - Ensure it outputs the Git version.
- Open a terminal or command prompt and type:
Step 3: Set Up GitHub Account
- Create a GitHub Account (if you don’t have one):
- Visit github.com and sign up.
- 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
- 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+Xon macOS). - Search for “GitHub Copilot” in the Extensions Marketplace.
- Click “Install” on the GitHub Copilot extension.
- Sign In to GitHub:
- After installation, VS Code will prompt you to sign in to GitHub.
- Click “Sign In” and follow the authorization process.
- 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
- 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).
- Go to File > Preferences > Settings (
Step 6: Test GitHub Copilot
- Open a New File:
- Create a new file with a relevant programming language extension (e.g.,
.pyfor Python,.jsfor JavaScript).
- Create a new file with a relevant programming language extension (e.g.,
- Write a Comment or Start Code:
- Begin typing a comment or some code. GitHub Copilot will suggest completions.
- Accept Suggestions:
- Press
Tabto accept a suggestion orEscto dismiss it.
- Press
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.
- Trigger Copilot suggestions manually with
- 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!
