Installing Git
Before using Git, you need to install it on your computer. Git is available for Windows, macOS, and Linux, and installation is quick using official installers or package managers.
Once installed, you can confirm Git works by checking its version from the command line. Most developers use Git entirely through the terminal, though graphical clients also exist.
git --versionInstalling on each OS
On Windows, download Git for Windows from git-scm.com. On macOS, run `xcode-select --install` or use Homebrew with `brew install git`. On Linux, use your package manager, such as `sudo apt install git` on Ubuntu/Debian.
Verifying installation
After installing, open a terminal and run `git --version`. If Git is installed correctly, it prints the version number instead of an error.
sudo apt install gitSetting up git (1:2.43.0-1) ...Installs Git on a Debian/Ubuntu based Linux system.
git --versiongit version 2.43.0Confirms Git was installed successfully by printing its version.
Key points
- Git works on Windows, macOS, and Linux.
- Package managers like apt, brew, and the official installer all work.
- git --version confirms a successful installation.
- Most Git usage happens from the command line.
