Git is available for all major operating systems. After installation, configure your name and email — Git embeds these in every commit you make. The --global flag applies the setting to all your repositories on this machine.
Git
Beginner
6 min read
Installing Git and First-Time Configuration
Example
# Install Git:
# macOS: brew install git
# Ubuntu: sudo apt install git
# Windows: https://git-scm.com/download/win
# Verify installation:
git --version
# First-time configuration (required before your first commit):
git config --global user.name "Jane Smith"
git config --global user.email "jane@example.com"
# Set your preferred editor (e.g., VS Code):
git config --global core.editor "code --wait"
# Set default branch name to 'main':
git config --global init.defaultBranch main
# Enable coloured output:
git config --global color.ui auto
# View all config settings:
git config --list
# View a single setting:
git config user.name