← Back to Chapters

Git Install

⚙️ Git Install

? Quick Overview

Git is a distributed version control system used to track changes in source code. To start using Git, you must install it on your operating system.

? Key Concepts

  • Git works on Windows, macOS, and Linux
  • Installation methods vary by OS
  • Verification ensures Git is ready to use

? Syntax / Theory

After installation, Git is accessed through the command line. The git --version command confirms the installed version.

? Installing Git on Windows

Download Git from the official website and follow the installer steps.

? View Code Example
// Check Git version on Windows
git --version

? Installing Git on macOS

Git can be installed using Homebrew.

? View Code Example
// Install Homebrew on macOS
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
? View Code Example
// Install Git using Homebrew
brew install git

? Installing Git on Linux

Use your distribution’s package manager.

? View Code Example
// Update package list on Ubuntu/Debian
sudo apt-get update
? View Code Example
// Install Git on Ubuntu/Debian
sudo apt-get install git
? View Code Example
// Install Git on Red Hat/Fedora
sudo yum install git

?️ Live Output / Explanation

Running git --version prints the installed Git version, confirming a successful installation.

? Use Cases

  • Source code version control
  • Team collaboration
  • Open-source contributions

? Tips & Best Practices

  • Always verify installation
  • Use default installer options
  • Keep Git updated

? Try It Yourself

  • Install Git on your OS
  • Run git --version
  • Try git init and git status