← Learning Hub
Beginner

Git Introduction and Setup

Git is a version control system. It saves snapshots of your project over time, so you can see what changed, go back to an older version, and work with other people without overwriting each other's work. Almost every software team in the world uses it.

Without version control, people keep copies like "project-final-v2-really-final.zip" and lose work when files are overwritten. Git records every change with who made it and why, lets you go back to any point, and lets many people work on the same project safely. It's used by almost every software team in the world.

GitHub (and GitLab, Bitbucket) is a website that stores Git projects online, so you can back them up, share them and collaborate.

Install and check

  • Windows: install from git-scm.com (it includes Git Bash).
  • macOS: run git --version - it offers to install, or use Homebrew.
  • Linux: sudo apt install git.
Example
git --version
# git version 2.47.0

Tell Git who you are (once per computer)

Example
git config --global user.name "Asha Verma"
git config --global user.email "asha@example.com"
git config --global init.defaultBranch main
git config --list

Your name and email are written into every snapshot (commit) you make. Use the same email as your GitHub account.

These lessons show commands for a terminal (Git Bash, Terminal, or the terminal inside VS Code). Lines starting with # show what Git prints back.
Key points
  • Git saves snapshots (commits) of your project.
  • GitHub hosts Git projects online.
  • Set your name and email once per computer.

📝 Test yourself

1. What does Git mainly do?
2. What is GitHub?
3. Fill in the setting name for your email:
git config --global user. "asha@example.com"