[TOC] #### 1. Git 概述 --- Git 是一个免费的、开源的 **分布式版本控制系统**。Git 易于学习,体积小,性能极快 版本控制是一种记录文件内容变化,以便将来查阅特定版本修订情况的系统,方便版本切换 #### 2. 安装 Git --- git 官网 : [https://git-scm.com](https://git-scm.com) **a. Windows** 下载适用于 Windows 系统的 Git:[https://git-scm.com/download/win](https://git-scm.com/download/win) **b. MacOS** 方案一: MacOS 中的 Xcode 自带 git,如果已经安装了 Xcode,直接使用 `git --version` 测试是否已有 git ``` git --version ``` 方案二: 使用 `Homebrew` 安装 git ``` brew install git ``` #### 3. Git GUI --- GUI 是指 Git 的图形界面管理软件, 使用 git 而非命令行操作 git 官网列出了多个可供基本上所有平台适用的 gui 软件:[https://git-scm.com/downloads/guis](https://git-scm.com/downloads/guis) ![](https://img.itqaq.com/art/content/ea77ce1aa71c17b980301e64ec4ef879.png) windows 上的 git 在任意位置单击右键可以看到 `Git GUI` 和 `Git Bash` ![](https://img.itqaq.com/art/content/d10c879233700edbd050c19f31517e01.png) 右键单击 `Git GUI` 会在当前目录下打开 `Git GUI` 工具,如果当前目录下没有 git 仓库,会弹出下图所示的窗口 : ![](https://img.itqaq.com/art/content/11eabb0579266a153a53d5e8af4801f5.png) 如果当前目录下有 git 仓库,则会出现下图所示窗口 : ![](https://img.itqaq.com/art/content/0f54de96a3497f054c95d20381b2451e.png) #### 4. Git Bash --- **可以通过 `~/.minttyrc` 文件,来自定义 Git Bash 终端样式** Git Bash 是 Windows 系统安装 Git 后自带的命令行终端工具,我会修改一些配置来更好使用它 ``` Locale=zh_CN Language=zh_CN Charset=UTF-8 Columns=85 Rows=25 Font=Cascadia Code FontHeight=12 BackgroundColour=0,30,40 CursorBlinks=no CursorType=underscore ``` **下面是修改 Git Bash 配置的示例** 修改默认窗口大小 ![](https://img.itqaq.com/art/content/803b2b6e1bf742c4e1a22a87834e751f.png) 修改字体及字体大小 ![](https://img.itqaq.com/art/content/23bd2b2e77cdce37b7ee3caa788fc437.png)