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

# Git v2 configuration file

> Reference for .omni/config.yaml, the file that sets the severity of each Git v2 pull request check.

> [!NOTE]
>
> Git v2 is available for GitHub repositories. To have Git v2 turned on for your organization, reach out to Omni support.

The `.omni/config.yaml` file sets the severity of each [pull request check](https://docs.omni.co/integrations/git/v2/checks.md). To add the file to a repository, see [Add a configuration file](https://docs.omni.co/integrations/git/v2/setup/github.md#optional-add-a-configuration-file).

Omni reads the file from the pull request's commit. If a pull request changes the file, Omni uses the new version to check that pull request.

If the file has an error, the commit status fails and the checks don't run. See [The configuration file has an error](https://docs.omni.co/integrations/git/v2/troubleshooting.md#the-configuration-file-has-an-error).

## Syntax

```yaml theme={null}
version: 1               # required
checks:                  # optional
  build: error           # always error
  sync: <severity>
  validation: <severity>
  # or, to set a different severity for base branch commits:
  validation:
    severity: <severity>
    default_branch: <severity>
models:                  # optional
  <model_path>:
    checks:              # required for each model you list
      <check>: <severity>
```

`version` is the one required property. Leave out `checks`, a single check, or `models` to use the default for that part.

## Properties

Key names, check names, and severities are case-insensitive.

**version** `integer` *required*

The version of the file format. Must be `1`.

**checks** `object`

Sets the severity of each check for every model in the repository. Use the check names as keys: `build`, `sync`, and `validation`. If you don't list a check, it uses its [default severity](#severity-and-defaults).

**checks properties**

**\<check>** `string | object`

The severity of the check: `error`, `warn`, or `off`.

The `build` check is always `error`, even if you set something else.

To set a different severity for commits to the base branch, use an object with these properties:

**\<check> properties**

**severity** `string`

The severity of the check on pull requests.

**default\_branch** `string`

The severity of the check on commits to the base branch. If you leave it out, the check uses `severity`. See [Checks on base branch commits](https://docs.omni.co/integrations/git/v2/merging.md#checks-on-base-branch-commits).

**models** `object`

Overrides the repository-wide severities for specific models. Use each model's path as a key.

**models properties**

**\<model\_path>** `object`

The model's path in the repository, such as `omni/Marketing`. See [Model path](https://docs.omni.co/integrations/git/settings.md#model-path).

Model paths are case-sensitive.

**\<model\_path> properties**

**checks** `object` *required*

Sets the severity of each check for this model, in the same format as the top-level `checks` block.

These values override the repository-wide ones. If you don't list a check here, the model uses the repository-wide severity.

## Severity and defaults

A check's severity controls what happens when the check fails.

| Severity | What it does |
| - | - |
| `error` | A failed check fails the commit status. |
| `warn` | A failed check shows in the comment, but the commit status passes. |
| `off` | Omni doesn't run the check. |

Each check has a default severity:

| Check | Default severity | Configurable |
| - | - | - |
| `build` | `error` | No |
| `sync` | `warn` | Yes |
| `validation` | `warn` | Yes |

## Examples

### Set a different severity for base branch commits

In this example, validation errors show as a warning on pull requests. On the base branch, a commit with validation errors fails the check, and Omni doesn't pull it into the shared model.

```yaml title=".omni/config.yaml" theme={null}
version: 1
checks:
  validation:
    severity: warn
    default_branch: error
```

### Default settings

These are Omni's default settings. If a sync or validation check fails, Omni warns you in its comment, and the commit status passes.

```yaml title=".omni/config.yaml" theme={null}
version: 1
checks:
  build: error
  sync: warn
  validation: warn
```

### Set sync and validation to error

In this example, a failed sync or validation check fails the commit status. To block the merge, see [Block merges on a failed check](https://docs.omni.co/integrations/git/v2/checks.md#block-merges-on-a-failed-check).

```yaml title=".omni/config.yaml" theme={null}
version: 1
checks:
  sync: error
  validation: error
```

### Override one model

In this example, validation is set to `error` for `omni/Marketing` and stays at `warn` for every other model.

```yaml title=".omni/config.yaml" theme={null}
version: 1
checks:
  validation: warn
models:
  omni/Marketing:
    checks:
      validation: error
```

## Next steps

* [Pull request checks](https://docs.omni.co/integrations/git/v2/checks.md)
* [Set up Git v2 with GitHub](https://docs.omni.co/integrations/git/v2/setup/github.md)
* [Git v2 settings](https://docs.omni.co/integrations/git/v2/settings.md)
* [Troubleshooting Git v2](https://docs.omni.co/integrations/git/v2/troubleshooting.md)
