Skip to content

Installing Git

Git is a powerful version control system that helps you manage and track changes in your codebase. Here's a simple guide on how to install Git on your machine:

Windows

  1. Download Git:

    Visit the official Git website at https://git-scm.com/download/win.

  2. Run Installer:

    Once the download is complete, run the installer and follow the on-screen instructions. Make sure to leave all default settings unless you have specific preferences.

  3. Adjusting your PATH environment:

    Choose the default option to "Use Git from Git Bash only" to avoid potential conflicts with other software. Select "Use the OpenSSL library" for secure connections.

  4. Choosing the Terminal Emulator:

    You can use Git Bash as your terminal emulator, providing a Unix-like environment on Windows. Alternatively, you can choose to use the Windows Command Prompt or PowerShell.

  5. Configuring Line Endings:

    Select "Checkout as-is, commit Unix-style line endings" unless you have a specific reason to choose otherwise.

  6. Completing the Installation:

    Click "Install" to complete the installation process.

  7. Updating Installation:

    git update-git-for-windows
    

macOS

  1. Install Homebrew:

    Open Terminal and run the following command to install Homebrew, a package manager for macOS:

    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
    
    2. Install Git:

    Once Homebrew is installed, run the following command to install Git:

    brew install git
    

Linux

Ubuntu/Debian

sudo apt update
sudo apt install git-all

Fedora

sudo dnf install git

Arch Linux

sudo pacman -S git

Update Git

sudo apt update
sudo apt install git

Verify Installation

Regardless of your operating system, after installation, open a terminal and run:

git --version
This should display the installed Git version, confirming a successful installation.

Now that Git is installed, you're ready to start using version control for your projects!