在各平台安装 Git 并进行最佳配置
安装 Git
Windows 安装
方式一:官方安装包(推荐)
- 访问 Git 官网 下载安装包
- 运行安装程序,按照向导进行安装
安装选项建议:
| 选项 | 建议 |
|---|---|
| Git Bash Here | ✅ 右键菜单添加 Git Bash |
| Git GUI Here | ✅ 右键菜单添加 Git GUI |
| Git LFS | ✅ 大文件支持 |
| 默认编辑器 | VS Code(推荐)/ Vim / Notepad++ |
| PATH 环境变量 | ✅ Git from the command line and also from 3rd-party software |
| HTTPS 传输后端 | ✅ Use the OpenSSL library |
| 行尾转换 | ✅ Checkout Windows-style, commit Unix-style line endings |
| 终端模拟器 | ✅ Use MinTTY(Git Bash 默认终端) |
| 默认分支名 | ✅ Override the default branch name: main |
2026/3/20大约 10 分钟