Git 2.54.0 保姆级安装攻略
安装选择链路(Step-by-Step)
Git
安装步骤(共 13 步)
安装步骤(共 13 步)
| 步骤 | 界面标题 | 推荐选择 | 备注 / 原因 |
|---|---|---|---|
| 1 | Select Components (选择组件) |
1. 取消勾选:Associate .sh files to be run with Bash2. 勾选: Check daily for Git for Windows updates3. 其余保持默认勾选 |
防止误触 .sh 文件;保持更新 |
| 2 | Select Start Menu Folder (开始菜单文件夹) |
保持默认 Git,点击 Next |
方便查找程序 |
| 3 | Choose the default editor (选择默认编辑器) |
选择 Use Notepad as Git’s default editor | 不要选 Vim。VS Code 还没装,先用记事本保底 |
| 4 | Name the initial branch (命名初始分支) |
选中 Override…,输入 main,点击 Next |
统一为 main,与 GitHub / Gitee 同步,避免后续改名麻烦 |
| 5 | Adjusting your PATH (调整环境变量) |
强烈推荐 选第二项: Use Git and optional Unix tools from the Command Prompt |
确保在 CMD 和 PowerShell 里都能用 Git。虽有红字警告,但日常开发无影响 |
| 6 | Choose the SSH executable (选择 SSH 工具) |
保持默认:Use bundled OpenSSH | Git 自带的最好用,无需额外配置 |
| 7 | Choose HTTPS transport (选择 HTTPS 后端) |
保持默认:Use the native Windows Secure Channel library | 使用 Windows 系统自带的库,兼容性最好 |
| 8 | Configure line endings (配置换行符) |
保持默认:Checkout Windows-style, commit Unix-style | 黄金法则:Windows 用 Windows 格式,提交到服务器用 Linux 格式 |
| 9 | Configure the terminal (配置终端模拟器) |
保持默认:Use MinTTY | 窗口可缩放、支持右键复制粘贴,比默认黑窗口好用太多 |
| 10 | Choose the default behavior (Pull 的行为) |
保持默认:Fast-forward or merge | 最稳妥的策略,遇到冲突能自动处理 |
| 11 | Choose a credential helper (凭证助手) |
保持默认:Git Credential Manager | 必选。记住密码,以后不用每次输账号 |
| 12 | Configuring extra options (额外选项) |
保持默认:Enable file system caching 和 Enable symbolic links 均勾选 | 开启缓存提速,支持符号链接 |
| 13 | Install | 点击 Install | 喝口水,等待安装完成 |