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.
git --version
# git version 2.47.0Tell Git who you are (once per computer)
git config --global user.name "Asha Verma"
git config --global user.email "asha@example.com"
git config --global init.defaultBranch main
git config --listYour name and email are written into every snapshot (commit) you make. Use the same email as your GitHub account.
# show what Git prints back.- Git saves snapshots (commits) of your project.
- GitHub hosts Git projects online.
- Set your name and email once per computer.
