What is Git?
Git is a distributed version control system that tracks changes in your code. It’s essential for collaborating with others and deploying your projects.
Installation
macOS
Git comes pre-installed on most Macs. Open Terminal and check:
git --versionIf not installed, you’ll be prompted to install Xcode Command Line Tools. Alternatively:
# Using Homebrew
brew install gitWindows
- Download the installer from git-scm.com
- Run the installer — the default settings are fine for most users
- Make sure “Git from the command line and also from 3rd-party software” is selected
- Open a new terminal and verify:
git --versionLinux
# Debian/Ubuntu
sudo apt update && sudo apt install git
# Fedora
sudo dnf install git
# Arch
sudo pacman -S gitInitial Configuration
After installing, set your identity:
git config --global user.name "Your Name"
git config --global user.email "your.email@example.com"Verify
git --version
git config --listYou should see your name and email in the output.