Installing and Configuring Git
Installing Git
On macOS
# Option 1: Using Homebrew (recommended)
brew install gitOption 2: Xcode Command Line Tools
xcode-select --install
On Windows
Download from git-scm.com and run the installer. Accept all defaults.On Linux (Ubuntu/Debian)
sudo apt update
sudo apt install git
Verifying Installation
git --version
Output: git version 2.43.0 (or similar)
First-Time Setup
Before using Git, tell it who you are. This information appears in every commit you make.
git config --global user.name "Your Name"
git config --global user.email "your.email@example.com"
Checking Your Configuration
git config --list
This shows all your Git settings.
Setting Your Default Editor
# For VS Code
git config --global core.editor "code --wait"For nano (simpler)
git config --global core.editor "nano"
Summary
| Command | Purpose |
|---|---|
| <code>git --version</code> | Check if Git is installed |
| <code>git config --global user.name "Name"</code> | Set your name |
| <code>git config --global user.email "email"</code> | Set your email |
| <code>git config --list</code> | View all settings |
💡 Note: You only need to do this setup once per computer.