Git Overview
Git is an open-source distributed version control system created by Linus Torvalds in 2005 for efficiently managing project code version history.
Core Features
- Distributed Architecture: Every developer has a complete repository copy
- High Performance: Fast handling of large projects
- Branch Management: Lightweight branch operations
- Integrity Protection: Uses SHA-1 hashing to ensure data integrity
Download and Install
Windows System
- Visit the official download page: Download Git
- Download the latest Windows installer
- Run the installer and follow the prompts to complete installation
- Recommended options during installation:
- Add Git to PATH
- Use Git Bash as the default terminal
- Configure line ending conversion (recommended: "Checkout as-is, commit Unix-style")
macOS System
Method 1 (Recommended):
bash
# Install using Homebrew
brew install gitMethod 2:
- Download the latest macOS installer
- Run the installer and follow the prompts to complete installation
Linux System
bash
# Debian/Ubuntu
sudo apt-get install git
# CentOS/RHEL
sudo yum install git
# Fedora
sudo dnf install gitInitial Configuration
After installation, configure user information
bash
git config --global user.name "Your Name"
git config --global user.email "your.email@example.com"Optional configuration
bash
# Set default editor (e.g. VSCode)
git config --global core.editor "code --wait"
# Enable colored output
git config --global color.ui autoVerify Installation
To verify successful installation, enter the following command in the terminal
bash
git --versionGUI Tools
- Git GUI (built-in)
- GitHub Desktop
- TortoiseGit (visual tool)
Learning Resources
Tip: After installation, it is recommended to run
git help tutorialto view the basic tutorial
- Official documentation: https://git-scm.com/doc
- Visual Git Guide: https://marklodato.github.io/visual-git-guide
- GitHub Learning Resources: https://guides.github.com
nuyoah