git --version. If you see a version number, it's installed. If not, download it from git-scm.com.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 gitif you have Homebrew, or just rungit --versionand 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
$ git --version - Open VS Code
- Press
Ctrl+`(backtick) to open the built-in terminal - 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
$ git config --global user.name "Your Name"
$ git config --global user.email "you@example.com" - Open the terminal (
Ctrl+`) - Run the two commands shown
- 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
$ 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 - These are one-time terminal commands
- On Windows,
core.autocrlf truekeeps 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.