Complete guide to installing Git and configuring it for optimal use across all major platforms
Step-by-step guide to installing Git on different operating systems and initial configuration steps.
Before installing Git, let's ensure you have everything needed for a smooth setup process. This guide covers all major platforms and will help you make the right choices for your development environment.
256MB RAM (1GB+ recommended)
1GB disk space for Git and repositories
Terminal/Command Line access
Windows 7 SP1 and later
macOS 10.13 and later
Linux (all major distributions)
Choose your operating system below for detailed installation instructions. Each guide
includes recommended settings and post-installation steps.
Download: Visit
git-scm.com/download/win
and download the latest version
Install: Run the installer with these
recommended settings:
Git Bash and Git GUI
Git from the command line
Use VS Code as default editor
Let Git decide default branch name
Git Credential Manager
Verify: Open Command Prompt or Git Bash and
type:
git --version
•
Enable symbolic links if you plan to use them
•
Choose "Checkout as-is, commit Unix-style" for line endings
•
Install Git Credential Manager for secure authentication
Option 1: Homebrew (Recommended)
Option 2: Xcode Command Line Tools
xcode-select --install
Option 3: Binary Installer
Download from
git-scm.com/download/mac
Debian/Ubuntu
Fedora
sudo dnf install git
Arch Linux
sudo pacman -S git
Consider installing gitk for GUI visualization
Set up credential storage with libsecret
Configure SSH keys for remote repositories
After installing Git, you'll need to configure it with your identity and preferences.
These settings will be used for all your Git operations.
The --global flag sets these configurations for all repositories on your system.
These settings help ensure consistent behavior across different systems.
Let's make sure everything is configured correctly by running some verification commands.
Add Git to your system's PATH variable or reinstall Git selecting the appropriate PATH option.
Run the installation with administrator/sudo privileges.
Check file permissions in your home directory and ensure .gitconfig is writable.
Update your Git installation or configure Git to use your system's certificates.
Now that you have Git installed and configured, you're ready to learn about Git's fundamental concepts:
Where you'll modify your files
Where you'll organize your changes
Where your project's history lives