Git Installation & Environment Setup

๐ŸŸข Beginner

๐Ÿ“– Definition

Setting up Git involves installing the Git Command Line Interface (CLI) binary tools on your operating system (Windows, Linux, or macOS) and verifying that the git executable is accessible from your system terminal or command prompt.

๐ŸŒ Multilingual Explanation

English

Installing Git provides the git command-line utility. On Windows, installing Git for Windows includes Git Bash, a Unix-like emulation terminal. On Linux and macOS, Git runs natively in the default terminal. Running git --version confirms successful installation.

Hindi

Git ko install karne se aapke computer mein git command available ho jati hai. Windows par Git for Windows install karne se Git Bash milta hai jo Unix terminal jaisa chalta hai. Linux aur macOS mein Git native terminal se chalta hai. Installation verify karne ke liye git --version run karein.

Marathi

Git install kelyanantar tumchya computer var git command chalute. Windows var Git for Windows install kelyas Git Bash milte. Linux aani macOS var default terminal madhye Git chalte. Installation check karanyasathi git --version vaparale jate.

Hinglish

Git setup karne par aapko terminal mein git commands chalaney ka access milta hai. Windows users ke liye Git Bash best terminal hai kyunki isme Linux commands (ls, pwd, cat) bhi chalte hain. Installation confirm karne ke liye terminal mein git --version Type karein.

๐Ÿค” Why Do We Use It?

Before you can create repositories, commit code, or connect to GitHub, the Git engine must be installed and properly registered in your operating system's executable path (PATH).

๐Ÿง  Simple Explanation

Installing Git is like installing the engine and steering wheel of a car. Without the Git engine installed on your machine, your code editor (like VS Code) cannot track changes or talk to GitHub.

๐Ÿ“ Installation Instructions Across Operating Systems

1. Windows Setup

1. Download the installer from the official website: git-scm.com/download/win.

2. Run the .exe installer.

3. Recommended Settings during Wizard:

  • Default Editor: Select VS Code (or your preferred editor).
  • PATH Environment: Select *Git from the command line and also from 3rd-party software*.
  • Line Ending Conversion: Select *Checkout Windows-style, commit Unix-style line endings* (core.autocrlf = true).
  • Terminal Emulator: Select Use MinTTY (Git Bash default).

2. Linux Setup

Open your terminal and run the package manager command for your distribution:

# Ubuntu / Debian

sudo apt update && sudo apt install git -y

Fedora / RHEL

sudo dnf install git -y

Arch Linux

sudo pacman -S git

3. macOS Setup

Option A โ€” Via Homebrew (Recommended):

brew install git

Option B โ€” Via Xcode Command Line Tools:

xcode-select --install

๐Ÿ’ก Verifying Installation

Open your terminal (Git Bash on Windows, Terminal on macOS/Linux) and run:

git --version

๐Ÿ” Command Breakdown

  • git: The root executable invoking the Git version control CLI tool.
  • --version: Flag asking Git to print its current installed semantic version string.

๐Ÿ‘€ Terminal Output

# Expected output on Windows / Linux / macOS:

git version 2.43.0

โš ๏ธ Common Mistakes

  • Command Not Found on Windows: Getting 'git' is not recognized as an internal or external command in Windows CMD or PowerShell.
  • *Fix:* Re-run installer and ensure *Add Git to PATH* is checked, or use Git Bash directly.
  • Using Wrong Terminal on Windows: Using default CMD without Unix command support instead of Git Bash.

๐Ÿ›ก๏ธ Safety / Important Notes

  • Always download Git from the official domain: https://git-scm.com.
  • Git Bash on Windows provides essential Unix tools like ssh-keygen, curl, grep, and bash.

๐ŸŒ Real-World Usage

Developers install Git as part of their initial machine setup alongside text editors (VS Code), runtime compilers, and terminal shells.

๐Ÿงช Try It Yourself

1. Open Git Bash (Windows) or Terminal (Linux/macOS).

2. Type git --version and press Enter.

3. Type git help to view the list of top-level Git commands available.

๐ŸŽฏ Mini Challenge

Run git help init in your terminal and observe how Git opens the official documentation in your default web browser or terminal pager.

๐Ÿ”— Related Topics

๐Ÿงญ Navigation

โ† Home | โ† Previous: Introduction | Next: Git Configuration โ†’