> ## Documentation Index
> Fetch the complete documentation index at: https://docs.diversion.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Set up Horde with Diversion (Windows, UE5 Source)

> Quickstart for wiring Diversion SCM to Horde and preparing a UE5 source repository for Horde CI.

<Note>Horde integration is available on the **[Studio](https://www.diversion.dev/pricing)** and **[Enterprise](https://www.diversion.dev/pricing)** plans. Please [contact us](mailto:support@diversion.dev) in order to receive a copy of the Diversion Horde installation files.</Note>

## Prerequisites

* Admin access to your **Horde Server** and **Horde Agent** machines (Windows).
* Access to **UE source on GitHub** via your Epic↔GitHub linked accounts.

  This is a general Horde requirement, as Horde build steps require access to the engine source and tools such as UAT & UBT.

**This guide assumes adept familiarity with Horde and its general setup process.**

***

## 1) Install & sign in to Diversion (Server + Agents)

1. Run the Diversion for Windows installer on the Horde Server and on **every Horde Agent**.
2. Launch Diversion and sign in on both Server and Agents so the integration has proper access to the UE5 source repository.

***

## 2) Prepare a UE5 source repo in Diversion (Windows)

### 2.1 Clone Unreal Engine source

Follow Epic’s instructions to gain GitHub access and clone UE:

* [UE on GitHub](https://www.unrealengine.com/en-US/ue-on-github)
* [Downloading Unreal Engine Source Code](https://dev.epicgames.com/documentation/en-us/unreal-engine/downloading-source-code-in-unreal-engine)

### 2.2 Remove `.gitignore` files from the cloned UE repo

Run **from the UE repo root** to avoid Git‑specific ignore behavior interfering with Diversion tracking.

```cmd theme={null}
for /r %f in (.gitignore) do @del "%f"
```

<Card title="Recommendation" icon="check" iconType="duotone" color="#0b8a42">
  You can remove the `.gitignore` files by any method you prefer (File Explorer search + delete, PowerShell, third‑party tools, etc.). The CMD loop above is our recommended approach because it’s recursive, robust, and low‑friction on Windows, it handles nested folders reliably and avoids common globbing quirks. Just make sure you run it from the UE repo root.
</Card>

### 2.3 Create `.dvignore` (before Diversion init)

Create **`.dvignore`** at the UE repo root with this starter (tune for your studio):

```ini theme={null}
# Epic's .dvignore file (converted from gitignore)
# Note: Diversion tracks directories as well as files
# - Uses same glob patterns as gitignore
# - ** pattern for recursive directory matching
# - Patterns are relative to .dvignore location

# Ignore root Visual Studio solution files only
*.sln

.p4sync.txt

# Visual Studio temp files
*.suo
*.opensdf
*.sdf

# Engine DerivedDataCache
/Engine/DerivedDataCache/*
**/DerivedDataCache/Boot.ddc
**/DerivedDataCache/**/*.udd

# Ignore all Intermediate and Saved directories
**/Intermediate/
**/Saved/

# UBT configuration
/Engine/Programs/UnrealBuildTool/
*.uatbuildrecord
*.tmp

# Build output
**/obj/
*.csprojAssemblyReference.cache

# UBT log files
/Engine/Programs/UnrealBuildTool/*.txt

# Python cache
*.pyc
__pycache__/

# JetBrains IDE
.idea/
!.idea/runConfigurations/
.gradle/

# HoloLens WMRInterop autogenerated files
/Engine/Source/ThirdParty/WindowsMixedRealityInterop/packages/
/Engine/Source/ThirdParty/WindowsMixedRealityInterop/MixedRealityInteropHoloLens/Generated Files/
/Engine/Source/ThirdParty/WindowsMixedRealityInterop/MixedRealityInteropHoloLens/x64/
/Engine/Source/ThirdParty/WindowsMixedRealityInterop/MixedRealityInteropHoloLens/ARM64/
/Engine/Source/ThirdParty/WindowsMixedRealityInterop/MixedRealityInterop/x64/
/Engine/Source/ThirdParty/WindowsMixedRealityInterop/MixedRealityInterop/ARM64/

# macOS Finder files
.DS_Store

# VS Code workspace files
*.code-workspace

.vs
```

<Card title="Warning!" icon="triangle-exclamation" iconType="duotone" color="#ca8b04">
  Create the `.dvignore` **before** you initialize the Diversion repo for easier and faster initial scan.

  The `.dvignore` must be under the root of the repo.
</Card>

### 2.4 Run UE setup scripts (Windows)

From the UE source root, run:

```cmd theme={null}
Setup.bat
GenerateProjectFiles.bat
```

### 2.5 Initialize a Diversion repo for UE

1. Initialize a Diversion repository **at the UE repo root** (Diversion CLI or UI).
2. Verify `.dvignore` is applied (caches/intermediates remain untracked).

### 2.6 Add your UE **project** to this source tree

Place your game project (that should compile against this source engine) in the expected path (often the UE repo root or a sibling path your BuildGraph expects). Commit required files to Diversion.

***

## 3) Point your Horde stream at a Diversion repo/branch

Do this **after** your UE5 source repository is prepared (Section 2).

Edit your stream config (`*.stream.json`) under the Horde config directory:

* `C:\\ProgramData\\Epic\\Horde\\Server\\`

Ensure the **`name`** field targets your Diversion repo and branch:

```json theme={null}
// Diversion‑required: set the repo id and branch name
"name": "//<repo-id>/<branch>"
```

> If your configs are split (globals → project → stream), place `name` in the **stream** JSON that represents your UE source stream.

***

## 4) Configure Horde for your UE source stream

1. Confirm your Horde config files live under `C:\\ProgramData\\Epic\\Horde\\Server\\`.
2. Ensure your project (`*.project.json`) references your stream (`*.stream.json`).
3. In the stream JSON, set the Diversion repo and branch mapping (*see Section 3*), then define the proper job templates (BuildGraph) and other general Horde requirements.
4. Start with a minimal Editor‑only BuildGraph job to validate the pipeline was set correctly.

> Horde’s config stack is **Globals → Projects → Streams**. Using the `.project.json`/`.stream.json` extensions enables JSON‑schema tooling.

***

## 5) Smoke test

* Restart or hot‑reload Horde after saving configs.
* In Horde Dashboard, open your project/stream, queue a small BuildGraph job based on your existing configuration, and confirm agents sync from Diversion and build.

***

## Quick reference (Windows)

* **Remove Git ignore files** (from UE repo root):

  ```cmd theme={null}
  for /r %f in (.gitignore) do @del "%f"
  ```

* **UE setup**

  ```cmd theme={null}
  Setup.bat
  GenerateProjectFiles.bat
  ```

***

## Further reading

* **[UE on GitHub](https://www.unrealengine.com/en-US/ue-on-github)** — linking Epic↔GitHub accounts
* **[Download UE Source](https://dev.epicgames.com/documentation/en-us/unreal-engine/downloading-source-code-in-unreal-engine)** — official guide
* **[Build UE from Source](https://dev.epicgames.com/documentation/en-us/unreal-engine/building-unreal-engine-from-source)** — Windows notes
* **[Horde (Overview)](https://dev.epicgames.com/documentation/en-us/unreal-engine/horde-in-unreal-engine)** — overview documentation
* **[Horde Orientation](https://dev.epicgames.com/documentation/en-us/unreal-engine/horde-orientation-for-unreal-engine)** — schema server, configs
* **[Horde Build Automation (Overview)](https://dev.epicgames.com/documentation/en-us/unreal-engine/horde-build-automation-for-unreal-engine)** — build automation overview
* **[Horde Build Automation (Tutorial)](https://dev.epicgames.com/documentation/en-us/unreal-engine/horde-build-automation-tutorial-for-unreal-engine)** — build automation tutorial
