---
title: "Working with YAMLMerge"
content_type: tutorial
url: "https://learn.unity.com/tutorial/working-with-yamlmerge?language=en"
language: en
difficulty: advanced
duration_minutes: 5
unity_version:
  - "2019.4"
supported_unity_versions:
  - name: "2019.4"
    url: "https://learn.unity.com/tutorial/working-with-yamlmerge.md?language=en&version=2019.4"
  - name: "2019.3"
    url: "https://learn.unity.com/tutorial/working-with-yamlmerge.md?language=en&version=2019.3"
  - name: "2019.2"
    url: "https://learn.unity.com/tutorial/working-with-yamlmerge.md?language=en&version=2019.2"
  - name: "2019.1"
    url: "https://learn.unity.com/tutorial/working-with-yamlmerge.md?language=en&version=2019.1"
  - name: "2018.4"
    url: "https://learn.unity.com/tutorial/working-with-yamlmerge.md?language=en&version=2018.4"
  - name: "2018.3"
    url: "https://learn.unity.com/tutorial/working-with-yamlmerge.md?language=en&version=2018.3"
  - name: "2018.2"
    url: "https://learn.unity.com/tutorial/working-with-yamlmerge.md?language=en&version=2018.2"
  - name: "2018.1"
    url: "https://learn.unity.com/tutorial/working-with-yamlmerge.md?language=en&version=2018.1"
last_updated: "2026-08-04T14:23:41.000Z"
---

# Working with YAMLMerge

Configure Git to use the YAMLMerge tool so you can merge Scene and prefab files safely under version control.

YAMLMerge (_unityyamlmerge.exe_) is a tool that is included with the Unity Editor and works with version control software to merge Scene and Prefab files. In this workflow, we’ll configure Git to use YAMLMerge.

## Working with YAMLMerge

This tutorial has been verified using Unity 2019.4.12f1 LTS

YAMLMerge (unityyamlmerge.exe) is a tool that is included with the Unity Editor and works with version control software to merge Scene and Prefab files. In this workflow, we’ll configure Git to use YAMLMerge. If you’d like to configure a different tool for use with YAMLMerge, please see [the Unity Manual](https://docs.unity3d.com/Manual/SmartMerge.html). YAMLMerge can also be run directly from the command line.

## Configuring Git to use YAMLMerge

1\. Open your .gitconfig file. This is typically in your user/home directory.

2\. At the end, type:

```csharp
[merge]
    tool = unityyamlmerge

[mergetool "unityyamlmerge"]
    trustExitCode = false
    cmd = 'C:\\Program Files\\Unity\\Hub\\Editor\\2019.2.11f1\\Editor\\Data\\Tools\\UnityYAMLMerge.exe' merge -p "$BASE" "$REMOTE" "$LOCAL" "$MERGED"
```

3\. The path to Unity will vary depending on your platform, version number, and whether you’ve installed Unity directly or through the hub.

## Configuring your Unity project

1\. From the Edit drop-down in the Unity Editor, select **Project Settings**.

2\. Click on **Editor**.

3\. Under Version Control, set Mode to **Visible Meta Files** if it’s not set already (**Figure 01**).

4\. Set Asset Serialization to **Force Text** if it’s not set already (**Figure 01**).

![Figure 01: With these settings, your project is now ready for version control.](https://connect-mediagw.unity.com/h1/20201229/learn/images/01f6dff4-c236-41f3-9e88-89358b3a4fc4_image1.png)

## Usage and advanced options

When there’s a merge conflict, open Git Bash and type: git mergetool.

When invoking YAMLMerge directly from the command line, you can specify which version of a file to keep by using -l or -r. You can also premerge by using the -p switch, and enable headless mode (suppress all error dialogs) by using -h. For more information on these options, invoke unityyamlmerge from the command line with no additional parameters.

## Conclusion

This has been a brief introduction to YAMLMerge, a tool that is included with Unity to resolve merge conflicts when using version control with your projects.
