Git 下载及安装教程
本文介绍 Git 在 Windows、macOS 和 Linux 系统上的下载与安装步骤,包含详细配置指南及避坑建议。
一、下载 Git
1. Windows 用户
官方下载地址:https://git-scm.com/download/win
(自动识别系统位数,点击下载 64-bit Git for Windows Setup)
2. macOS 用户
- 方法 1(推荐):打开终端 → 安装 Homebrew → 输入命令:
brew install git
- 方法 2:下载官方安装包:https://git-scm.com/download/mac
3. Linux 用户
# Debian/Ubuntu
sudo apt update && sudo apt install git -y
# CentOS/RHEL
sudo yum install git -y
二、安装 Git(Windows 详细步骤)
以 Windows 11 为例
Step 1:运行安装程序
双击下载的 Git-X.XX.X-64-bit.exe 文件启动安装向导。
Step 2:关键配置选项
| 步骤 | 选择项 | 推荐操作 |
|---|---|---|
| 许可协议 | - | 点击 Next |
| 安装路径 | Select Destination Location | 默认路径 C:\Program Files\Git\(无需修改)→ Next |
| 组件选择 | Select Components | ✅ Additional icons(创建桌面图标)✅ Windows Explorer integration(右键菜单)→ Next |
| 开始菜单 | Select Start Menu Folder | 默认 → Next |
| 默认编辑器 | Choosing the default editor |


