Git & GitHub with VS Code: A Student’s Guide

Hope you enjoy!
~>Sir Roy C:


Welcome to the world of version control! With Git and GitHub, you can save your code, track changes, and collaborate with friends—all inside Visual Studio Code (VS Code). This guide will help you get started, step by step.


1. What is Git? What is GitHub?


2. Setting Up Git

Install Git

If you haven’t already, follow your installation guide to install Git on your computer.

Configure Your Identity

Open a terminal in VS Code (Ctrl + backtick or View > Terminal) and enter:

git config --global user.name "Your Name"
git config --global user.email "your@email.com"

This tells Git who you are, so your commits are labeled correctly.


3. Sign Up for GitHub

  1. Go to github.com and click Sign up.
  2. Choose a username, enter your email, and create a password.
  3. Follow the prompts to finish setting up your account.
  4. (Optional but recommended) Add a profile picture and bio!

4. Connect VS Code to GitHub

Sign In to GitHub

  1. Click the Accounts icon in the lower-left corner of VS Code.
  2. Click Sign in with GitHub.
  3. Follow the prompts in your browser to authorize VS Code.

Now, VS Code can talk to your GitHub account!


5. Using Git in VS Code: The Basics

VS Code has built-in Git tools—no need to memorize commands!

Useful Git Functions in VS Code

Bonus: Resolving Merge Conflicts

If you and a friend edit the same file, VS Code will highlight conflicts and let you choose which changes to keep.


6. Typical Workflow

  1. Make changes to your code.
  2. Stage the files you want to save.
  3. Commit with a message describing your changes.
  4. Push to GitHub to back up your work or share with others.

7. Tips for High School Students


8. More Resources


With these tools, you’re ready to code, collaborate, and conquer your projects! 🚀