Git is a command-line tool. You'll run it from a terminal (also called a shell or command prompt). If you've been opening files in VS Code, you're already most of the way there — VS Code has a built-in terminal.
Open a Terminal in VS Code
- Open VS Code.
- Go to Terminal → New Terminal (or press
Ctrl+`on Windows/Linux,Cmd+`on Mac). - A panel opens at the bottom. That's your terminal.
You'll see a blinking cursor waiting for commands. This is where you'll type Git commands.
Install Git
Git may already be installed. Check first:
git --version
If you see something like git version 2.43.0, you're ready — skip to the next section.
If you get an error, install Git:
- Windows — Download from git-scm.com and run the installer. Accept the defaults unless you know you need something different.
- Mac — Run
xcode-select --installin the terminal, or install via git-scm.com. - Linux — Use your package manager, e.g.
sudo apt install giton Ubuntu.
After installing, close and reopen your terminal, then run git --version again.
Configure Your Identity
Git attaches your name and email to every commit you make. Set them once:
git config --global user.name "Your Name"
git config --global user.email "you@example.com"
Use your real name and the email you'd want on a résumé or GitHub profile. These commands save settings in a global config file — you won't need to run them again on this computer.
Verify your settings:
git config --global user.name
git config --global user.email
Each command should print back what you just set.
A Few Useful Commands
Before we dive into repos, get comfortable with the terminal basics:
# Where am I right now?
pwd
# What's in this folder?
ls
# Move into a folder
cd my-project
# Move up one folder
cd ..
# Move to your home directory
cd ~
On Windows, ls might not work in older shells — use dir instead, or use Git Bash (installed with Git for Windows) where ls works like on Mac/Linux.
You're set up. In the next lesson we'll create our first Git repository.