Install & Set Up

1. Install Git

Git is a free download. Pick your operating system:

  • Windows — download from git-scm.com and click through the installer (the defaults are fine). This also gives you "Git Bash", a terminal you can use.
  • Mac — the easiest way is brew install git if you have Homebrew, or just run git --version and macOS will offer to install it.
  • Linux — use your package manager, e.g. sudo apt install git.

To check it worked, open a terminal and run:

Check the install

Terminal
$ git --version
In VS Code
  1. Open VS Code
  2. Press Ctrl+` (backtick) to open the built-in terminal
  3. Type the command and press Enter

You should see a version number like 'git version 2.45.0'. If you do, Git is installed.

2. Tell Git who you are

Every commit is stamped with a name and email. Set them once and Git remembers. Use the same email you'll use on GitHub.

One-time identity setup

Terminal
$ git config --global user.name "Your Name"
$ git config --global user.email "you@example.com"
In VS Code
  1. Open the terminal (Ctrl+`)
  2. Run the two commands shown
  3. These settings apply to every project on your computer

--global means 'for all my projects'. You only do this once per computer.

3. Install VS Code

VS Code is a free code editor with excellent built-in Git support. After installing it, the key thing to know is the Source Control panel — the icon in the left sidebar that looks like a branching line (three dots connected by lines). That panel is where you'll stage, commit, push and pull without typing a single command.

Tip: In VS Code, the Source Control icon shows a little number badge whenever you have unsaved changes waiting to be committed. It's your at-a-glance status.

GitHub account? Sign-up and the one-time authentication (VS Code sign-in, tokens, SSH keys, gh auth login) have their own chapter: Connect to GitHub. You can do it now or when you first push.

4. Handy one-time settings

A few config tweaks that smooth over the most common beginner snags:

Recommended global config

Terminal
$ git config --global init.defaultBranch main   # new repos start on 'main'
$ git config --global core.editor "code --wait"     # write messages in VS Code
$ git config --global pull.rebase false             # merge on pull (simple default)
$ git config --list                                 # review everything you've set
In VS Code
  1. These are one-time terminal commands
  2. On Windows, core.autocrlf true keeps line endings tidy across machines — decoded in CRLF vs LF

--global applies to every project. Run the same command without --global inside a repo to set it for just that one.

That's the whole setup. From here on, the chapters are about using Git day to day.

Up next: what a repository is, and how to start tracking a project.

FAQ

Frequently Asked Questions

How do I check whether Git is already installed?
Open a terminal and run git --version. If you see a version number, it's installed. If not, download it from git-scm.com.
Which terminal should I use on Windows?
Any of them — Git Bash (installed with Git), PowerShell, or VS Code's built-in terminal all run the same git commands. This guide's commands work identically in each.
How do I update Git?
On Windows, run git update-git-for-windows or just install the newest version from git-scm.com over the old one. On a Mac with Homebrew, brew upgrade git. Your repos and settings are untouched.
Why does Git ask for my name and email?
Every commit is stamped with who made it. Set them once with git config --global user.name and user.email. Use the same email as your GitHub account so your commits link to your profile.