1. 官网下载git
官网下载地址:https://git-scm.com/downloads
2. 安装git
1)双击安装包,显示如下:
2)选择安装路径
3)选择安装配置:
4)选择开始菜单文件夹
扫描二维码关注公众号,回复:
12678715 查看本文章

5)选择默认编辑器
Use the Nano editor by default
# 默认使用 Nano 编辑器
Use Vim (The ubiquitous text editor) as Git's default editor
# 使用 Vim 作为 Git 的默认编辑器
Use Notepad++ as Git's default editor
# 使用 Notepad++ 作为 Git 的默认编辑器
Use Visual Studio Code as Git's default editor
# 使用 Visual Studio Code 作为Git 的默认编辑器
Use Visual Studio Code Insiders as Git's default editor
# 使用Visual Studio Code Insiders 作为 Git 的默认编辑器
6)确定新存储库初始分支的名称
7)调整path环境变量,选择第二项安全,避免污染其他环境,您将能够从 Git Bash 和 Windows 命令提示符中使用 Git。
8)选择HTTPS传输后端
9)配置行结束符
10)配置终端模拟器
11)选择git上传的默认行为
12)选择Git凭证管理器
https://github.com/microsoft/Git-Credential-Manager-Core
13)额外选项
14)安装
3. 测试安装是否成功
打开命令窗,输入git --version
,成功显示版本
4. 自定义设置
1)打开开始菜单的Git Bash
2)设置用户名及邮箱
注意git config
命令的--global
参数,用了这个参数,表示你这台机器上所有的Git仓库都会使用这个配置,当然也可以对某个仓库指定不同的用户名和Email地址。
$ git config --global user.name "Your Name"
$ git config --global user.email "[email protected]"
3)让Git显示颜色,会让命令输出看起来更醒目:
$ git config --global color.ui true