一、安装(核心选项直接抄)
| 安装界面 | 选择建议 | 核心原因 |
|---|---|---|
| 组件选择 | ✅ 保留默认勾选,取消 Check daily for updates | 自动更新没必要,核心功能够用 |
| 默认编辑器 | ✅ 选 Use Visual Studio Code as Git's default editor | 避免 Vim 学习成本,和开发工具统一 |
| 初始分支名 | ✅ 选 Override,分支名填 main | 适配 GitHub/Gitee 主流规范 |
| PATH 配置 | ✅ 选 Git from the command line and also from 3rd-party software | 多终端可用(Git Bash/CMD/VSCode) |
| SSH 客户端 | ✅ 选 Use bundled OpenSSH | 自带工具兼容性更好,无需额外安装 |
| HTTPS 后端 | ✅ 选 Use the native Windows Secure Channel library | 系统原生适配,无需手动管理证书 |
| 换行符处理 | ✅ 选 Checkout Windows-style, commit Unix-style | 跨平台协作不冲突 |
| 终端模拟器 | ✅ 选 Use MinTTY | 界面更友好,支持窗口缩放 |
| git pull 行为 | ✅ 选 Fast-forward or merge | 保留提交历史,适合个人/团队开发 |
| 凭证管理器 | ✅ 选 Git Credential Manager | 自动保存账号密码,免重复输入 |
| 额外选项 | ✅ 保留 Enable file system caching,取消 Enable symbolic links | 提升性能,Windows 下符号链接兼容性差 |
二、安装后配置
打开 Git Bash,逐行执行以下命令:
# 配置用户名,替换为你的 GitHub 用户名(如 zhangsan123)
git config --global user.name "YourGitHubName"
# 配置邮箱,替换为你的 GitHub 注册邮箱(如 [email protected])
git config --global user.email "[email protected]"

参数说明:--global 表示全局配置,即所有本地 Git 仓库都会使用该信息,无需重复配置。









