Installing Git is straightforward, and the process varies slightly depending on your operating system. Here’s how to install Git on **Windows**, **macOS**, and **Linux**:
—
### **1. Install Git on Windows**
#### **Option 1: Install Git via Official Installer**
1. **Download Git** from the official website:
→ [https://git-scm.com/download/win](https://git-scm.com/download/win)
2. **Run the installer** (`Git-x.x.x-64-bit.exe`).
3. Follow the setup wizard (default options are fine for most users).
4. **Verify installation** by opening **Command Prompt** (`cmd`) and running:
“`sh
git –version
“`
#### **Option 2: Install Git via Winget (Windows Package Manager)**
Run in **PowerShell** or **Command Prompt**:
“`sh
winget install –id Git.Git -e –source winget
“`
—
### **2. Install Git on macOS**
#### **Option 1: Install Git via Homebrew (Recommended)**
1. Open **Terminal**.
2. Install **Homebrew** (if not already installed):
“`sh
/bin/bash -c “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)”
“`
3. Install Git:
“`sh
brew install git
“`
4. Verify:
“`sh
git –version
“`
#### **Option 2: Install Git via Xcode Command Line Tools**
Run in **Terminal**:
“`sh
xcode-select –install
“`
This will install Git along with other developer tools.
—
### **3. Install Git on Linux**
#### **Debian/Ubuntu (apt)**
“`sh
sudo apt update && sudo apt install git -y
“`
#### **Fedora (dnf)**
“`sh
sudo dnf install git -y
“`
#### **Arch Linux (pacman)**
“`sh
sudo pacman -S git
“`
#### **Verify Installation**
“`sh
git –version
“`
—
### **Post-Installation Setup (Recommended)**
After installing Git, configure your username and email (required for commits):
“`sh
git config –global user.name “Your Name”
git config –global user.email “[email protected]”
“`
Check your settings:
“`sh
git config –list
“`
—
### **Next Steps**
– Learn basic Git commands (`git clone`, `git add`, `git commit`, `git push`).
– Use a GUI tool like **GitHub Desktop**, **Sourcetree**, or **VS Code Git integration**.
Let me know if you need help with any step! 🚀
Leave a Reply