Git Topic
Installation and Setup
What You'll Learn:
-
How to install Git on different operating systems
-
Basic configuration for first-time use
-
Setting up your identity and preferences
Detailed Explanation:
Installation Methods
Windows:
# Download from git-scm.com
# Or use package managers:
choco install git # Chocolatey
winget install Git.Git
macOS:
# Using Homebrew
brew install git
# Or download from git-scm.com
Linux:
# Ubuntu/Debian
sudo apt update && sudo apt install git
# CentOS/RHEL
sudo yum install git
# Fedora
sudo dnf install git
Essential Configuration
# Set your identity (required for commits)
git config --global user.name "Your Name"
git config --global user.email "your.email@example.com"
# Set default branch name
git config --global init.defaultBranch main
# Configure line ending handling
git config --global core.autocrlf true # Windows
git config --global core.autocrlf input # macOS/Linux
# Set default editor
git config --global core.editor "code --wait" # VS Code
git config --global core.editor "nano" # Nano
# Enable colorful output
git config --global color.ui auto
# Check your configuration
git config --list
Verification
# Verify installation
git --version
# Check configuration
git config --global --list
Common Setup Scenarios
-
Personal development machine
-
CI/CD environments
-
Team development standards
Comments (0)
No comments yet. Be the first to comment!