Complete guide to installing Git and performing basic configuration across all platforms (Windows, macOS, Linux, WSL). Use when setting up Git for the first time, installing Git on new systems, configuring user identity, setting default branch, choosing editor, verifying installation, or troubleshooting Git installation issues. Covers platform-specific installation methods, basic required configuration, and verification steps.
Limited to specific tools
Additional assets for this skill
This skill is limited to using the following tools:
references/configuration-details.mdreferences/git-bash-history-troubleshooting.mdreferences/install-linux.mdreferences/install-macos.mdreferences/install-windows.mdreferences/install-wsl.mdreferences/testing-evaluations.mdComplete guidance for installing Git and performing essential initial configuration across Windows, macOS, Linux, and WSL environments.
This skill helps you:
For advanced configuration (aliases, performance tuning, credential management, maintenance), see the config skill.
Use this skill when:
Fastest path to getting Git installed and configured:
# Install Git
winget install --id Git.Git -e --source winget
# Configure identity
git config --global user.name "Your Name"
git config --global user.email "your.email@example.com"
git config --global init.defaultBranch main
# Verify
git --version
# Install Git
brew install git
# Configure identity
git config --global user.name "Your Name"
git config --global user.email "your.email@example.com"
git config --global init.defaultBranch main
# Verify
git --version
# Install Git (Ubuntu/Debian)
sudo apt update && sudo apt install git
# Configure identity
git config --global user.name "Your Name"
git config --global user.email "your.email@example.com"
git config --global init.defaultBranch main
# Verify
git --version
When helping users with Git installation, detect their platform using environment indicators:
$env:OS contains "Windows", PowerShell commands, winget, file paths like C:\uname -s returns "Darwin", Homebrew (brew), ~/.zshrcuname -s returns "Linux", package managers (apt, dnf, pacman), ~/.bashrc/mnt/c/), wsl.exe availableProvide platform-specific guidance automatically based on detected or stated platform.
Two installation options: Git for Windows Installer (full control, recommended) or winget (quick install). Includes Windows-specific configuration (long paths, system-level settings) and troubleshooting.
š Full guide: references/install-windows.md
Topics covered: Installation options, verification, Windows-specific configuration, Win32 long paths, troubleshooting, Git Bash history issues
Two installation options: Xcode Command Line Tools (quick, built-in) or Homebrew (latest version, recommended). Includes macOS-specific configuration, shell integration (Zsh/Bash), and global gitignore setup.
š Full guide: references/install-macos.md
Topics covered: Installation options, verification, line ending configuration, Zsh/Bash shell integration, global gitignore
Installation via package manager: apt (Ubuntu/Debian), dnf (Fedora/RHEL), or pacman (Arch Linux). Includes Linux-specific configuration, shell integration (Bash/Zsh), and global gitignore setup.
š Full guide: references/install-linux.md
Topics covered: Distribution-specific installation, verification, line ending configuration, Bash/Zsh shell integration, global gitignore
WSL runs Linux (Ubuntu by default), so Git installation is identical to native Linux. Includes WSL-specific configuration and performance considerations.
š Full guide: references/install-wsl.md
Topics covered: Installation (same as Linux), verification, WSL-specific configuration, filesystem performance notes, Windows integration, credential sharing
After installing Git, configure these essential settings:
git config --global user.name "Your Name"
git config --global user.email "your.email@example.com"
Important: This information is included in every commit. Use your real name and work/personal email.
git config --global init.defaultBranch main
Note: Modern standard is main (replacing older master convention).
Choose one:
# VS Code (must be in PATH)
git config --global core.editor "code --wait"
# Notepad (Windows)
git config --global core.editor "notepad"
# Vim
git config --global core.editor "vim"
# Nano (Linux/macOS)
git config --global core.editor "nano"
Note: If not set, Git uses system default editor (usually Vim on Linux/macOS, Notepad on Windows).
After installation and configuration, verify everything is working:
git --version
# View all configuration with source files
git config --list --show-origin
# View specific values
git config user.name
git config user.email
git config init.defaultBranch
# Create test repository
mkdir test-repo
cd test-repo
git init
# Create and commit a file
echo "# Test Repository" > README.md
git add README.md
git commit -m "Initial commit"
# View commit history
git log
# Clean up
cd ..
rm -rf test-repo
Expected result: Repository created, commit successful, log shows your commit.
For comprehensive details on configuration file locations, hierarchy, conditional includes, and troubleshooting, see Configuration Details.
Quick reference:
/etc/gitconfig (all users, requires sudo)~/.config/git/config or ~/.gitconfig (current user).git/config (current repository)To remove/unset a config value:
# Unset system config value (requires admin/sudo)
git config --system --unset status.aheadbehind
# Unset global/user config value
git config --global --unset status.aheadbehind
# Unset local config value (inside a repo)
git config --unset status.aheadbehind
All references in this skill are conditionally loaded based on platform detection or troubleshooting context. This progressive disclosure strategy keeps the skill efficient by loading only relevant content when needed.
references/install-windows.md - Load when user is on Windows platform (install workflow)references/install-macos.md - Load when user is on macOS platform (install workflow)references/install-linux.md - Load when user is on Linux platform (install workflow)references/install-wsl.md - Load when user is on WSL platform (install workflow)references/git-bash-history-troubleshooting.md - Load when troubleshooting Git Bash command history issues on Windows TerminalToken efficiency: Most users follow the Quick Start path (~3k tokens). Platform-specific deep dives load only the relevant reference (~3.5-4k tokens total).
After completing basic Git setup, consider:
Advanced Configuration: Use the config skill for:
Line Ending Management: Use the line-endings skill for:
.gitattributes for cross-platform teamsCommit Signing: Use the gpg-signing skill for:
GUI Tools: Use the gui-tools skill for:
.gitattributes, Git LFSFor comprehensive test scenarios, multi-model testing notes, formal evaluations, and development methodology, see Testing and Evaluations.
Evaluation Summary: 3/3 evaluations passed - Tested with Claude Sonnet 4.5 and Claude Sonnet 3.5
Installation Guides:
Configuration:
Troubleshooting:
Testing:
Date: 2025-11-28 Model: claude-opus-4-5-20251101