# 选择 Git 可执行文件

> Explore Git executable option to use for Windows builds, including Native and Cygwin options.

如果您使用的是 Windows 操作系统，Unity Build Automation 支持为构建选择要使用的 **Git 可执行文件**。

## Git 可执行文件选项##git-executable-options

Unity Build Automation 目前针对 Windows 操作系统支持以下 **Git 可执行**选项：

* Native（原生）
* Cygwin

### Native（原生）##native

如果选择此选项，在 Windows 操作系统上运行的构建将使用 Windows 原生的 *Git* 客户端来克隆源代码。这是新项目的默认和推荐选项，并且代码仓库越大，使用此选项进行克隆的性能往往提升越明显。

### Cygwin##cygwin

如果选择此选项，在 Windows 操作系统上运行的构建将使用 [Cygwin](https://www.cygwin.com/) *Git* 客户端。此选项适用于需要更好地与 Linux 和 macOS Git 设置兼容的情况。此外，如果代码仓库中使用了基于 Linux 的符号链接，也建议使用此选项。

## 配置 Git 可执行文件##configure-git-executable

您可以在两个级别上配置 Windows Git 可执行文件：针对特定项目，或者针对构建目标配置。

### 针对项目配置 Git 可执行文件##configure-the-git-executable-for-a-project

1. 在 Unity Dashboard 中，选择 **DevOps** > **Build Automation** > **Settings（设置）**。
2. 选择 **Source Control（源代码控制）**。
3. 如果您的 SCM 为 *Git*，则选择要使用的 *Git 可执行文件*。
4. 选择 **Save（保存）**。

### 针对构建目标配置配置 Git 可执行文件##configure-your-git-executable-for-a-build-target-configuration

> **Note:**
>
> **注意**：此选项会覆盖项目级别的 Git 可执行文件设置。

1. 在 Unity Dashboard 中，选择 **DevOps** > **Build Automation** > **Configurations（配置）**。
2. 选择要编辑的构建配置上的编辑图标，然后转到 **Advanced Settings（高级设置）**。
3. 如果 SCM 为 *Git*，而操作系统为 Windows，则可以选择 Git 可执行文件。
4. 默认选项为 *Inherit（继承）*，即从项目设置继承该选项，但您可以覆盖所编辑构建目标的此设置。
5. 选择 **Save changes（保存更改）**。
