> ## 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.

# Troubleshooting Git v2

> Diagnose and resolve common issues with Git v2, including a missing or unavailable version setting, base branch commits that don't appear in Omni, and missing or failed pull request checks.

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

Use this page to diagnose common issues with [Git v2](https://docs.omni.co/integrations/git/v2). Each scenario describes what you're seeing, why it happens, and how to fix it.

## The Git integration version setting isn't in git settings

**1. What you're seeing**

The model's git settings don't have a **Git integration version** section.

**2. Why it happens**

Git v2 isn't turned on for your Omni organization.

**3. How to fix it**

Reach out to Omni support to have Git v2 turned on.

## 'Requires GitHub App or token authentication' on the version setting

**1. What you're seeing**

You can't turn on **Use v2 Git integration**. The setting shows **Requires GitHub App or token authentication**.

**2. Why it happens**

The repository is connected to Omni with SSH authentication. Git v2 requires GitHub App or HTTPS token authentication.

**3. How to fix it**

1. In the model's git settings, click **Unlink Git**.
2. Connect the repository again with the **GitHub App** or **HTTPS token authentication** method. See the [GitHub setup guide](https://docs.omni.co/integrations/git/setup/github.md).
3. Turn on **Use v2 Git integration**.

## Commits to the base branch don't appear in Omni

**1. What you're seeing**

Someone commits a model change directly to the model's base branch, and the shared model in Omni doesn't change.

**2. Why it happens**

Omni learns about these commits from GitHub's **Push** webhook event.

To find the cause, open the repository's **Settings > Webhooks** page in GitHub, click the Omni webhook, and open **Recent Deliveries**.

| What Recent Deliveries shows | Cause |
| - | - |
| No **push** delivery for the commit | The webhook doesn't send the Push event |
| A **push** delivery with the response `Push ignored: there is nothing in it for a model on this base branch to load` | The commit is on another branch, it changed no file in the model's folder, or Git v2 is turned off for the model |

**3. How to fix it**

* **The webhook doesn't send the Push event** - Edit the webhook and select the **Push** event. See [Set up Git v2 with GitHub](https://docs.omni.co/integrations/git/v2/setup/github.md).
* **The push was ignored** - Confirm that the commit is on the model's [base branch](https://docs.omni.co/integrations/git/settings.md#base-branch), that it changed a file under the model's [model path](https://docs.omni.co/integrations/git/settings.md#model-path), and that **Use v2 Git integration** is on for the model.

## No commit status appears on a pull request

**1. What you're seeing**

A pull request in a repository that uses Git v2 is missing the `Model: <model_path>` commit status, Omni's comment, or both.

**2. Why it happens**

Common causes:

* **The pull request doesn't change the model's files.** Omni posts a passing status with the text `This pull request does not change the model`, and doesn't post a comment.
* **GitHub didn't deliver the Pull request event.** Omni learns about pull requests from the repository's webhook.
* **The repository's credentials are missing a GitHub permission.** Omni needs the **Commit statuses** permission to post the status and the **Pull requests** permission to post the comment.

**3. How to fix it**

1. In GitHub, open the repository's **Settings > Webhooks** page and confirm that the Omni webhook sends the **Pull request** event. To check whether a delivery reached Omni, see [Webhook deliveries](https://docs.omni.co/integrations/git/webhook-deliveries.md).
2. If the repository uses HTTPS token authentication, confirm that the token has the **Pull requests** and **Commit statuses** permissions set to Read and write.
3. If the repository uses the Omni GitHub App, ask a GitHub organization owner to review the app's installation and accept any pending permission request.
4. Push a new commit to the pull request to run the checks again.

## Omni can't load a commit

**1. What you're seeing**

The `Model: <model_path>` commit status shows an error that reads `Omni could not load this commit`. Omni's comment reads `Omni could not load this commit, so its checks did not run.`

**2. Why it happens**

A git or server error stopped Omni from reading the commit.

**3. How to fix it**

1. Open Omni's comment on the pull request. The error is in the code block in the comment.
2. If the error points to something in the repository, fix it and push a new commit to run the checks again. Otherwise, reach out to Omni support and include the error text.

## The build check fails

**1. What you're seeing**

The commit status fails and reads `❌ Build · » Sync · » Validation`. In Omni's comment, the build check shows `Omni could not read the model files` with an error underneath. The sync and validation checks show `not run`.

**2. Why it happens**

Omni can't read one of the model files in the commit. See [Build](https://docs.omni.co/integrations/git/v2/checks.md#build) for the causes. Omni skips the other checks when the build check fails.

The build check's [severity](https://docs.omni.co/integrations/git/v2/config-file.md#severity-and-defaults) is always `error`, so a failed build check always fails the status.

**3. How to fix it**

1. Read the error under the build check in Omni's comment.
2. Fix the file mentioned in the error, then push the fix to the pull request.

Omni runs the checks again on the new commit.

## The pull request has no Omni branch

**1. What you're seeing**

The commit status reads `» Build · ✅ Sync · » Validation`. In Omni's comment, the sync check reads `no Omni branch tracks this PR; create one or turn on branch-per-pull-request`.

**2. Why it happens**

No Omni branch exists for the pull request, so Omni has no branch to pull the commit into.

**3. How to fix it**

1. Turn on [Always create branches](https://docs.omni.co/integrations/git/settings.md#always-create-branches) in the model's git settings.
2. Push a new commit to the pull request. Omni creates the branch and runs the checks again.

## The configuration file has an error

**1. What you're seeing**

The `Model: <model_path>` commit status fails with text that starts with `.omni/config.yaml did not parse:`. Omni doesn't post a comment.

**2. Why it happens**

Omni couldn't read the configuration file on the pull request's commit, so the checks didn't run. The text after the colon gives the reason. For example:

* `version is required`
* `version 2 is not valid; use 1`
* `model "omni/Marketing" has no checks block`
* `check "sync" uses level; use severity`

**3. How to fix it**

Correct `.omni/config.yaml` on the pull request branch and push the change. See the [configuration file reference](https://docs.omni.co/integrations/git/v2/config-file.md) for the file format.

## A commit pushed to the pull request doesn't appear in the Omni branch

**1. What you're seeing**

Someone pushes a commit to the pull request branch in GitHub, and the Omni branch doesn't change. Omni's comment on the pull request says `Omni has not pulled this commit into the branch yet; pull it from the IDE`.

**2. Why it happens**

On a Git v2 repository, new commits on a pull request branch wait in git until you pull them into the Omni branch.

**3. How to fix it**

1. Open the branch in the model IDE.
2. Click the down arrow in the branch header, or click **Branch options > Pull from git**.

See [Pull and push changes](https://docs.omni.co/integrations/git/v2/pull-and-push.md#pull-changes-from-git).

## 'Model files in git have errors' in the branch header

**1. What you're seeing**

The branch header in the model IDE shows a warning icon next to the pull and push arrows. The tooltip is **The model files in git have errors. Click for details.** Clicking an arrow opens the **Model files in git have errors** dialog.

**2. Why it happens**

The latest commit on the pull request has model files that Omni can't read. Examples are a YAML file that doesn't parse and a property with a value of the wrong type. Omni can't pull the commit until the files are fixed.

**3. How to fix it**

1. Click the warning icon to open the **Model files in git have errors** dialog. The dialog shows the commit and the error.
2. Fix the errors in the model files in git and push the fix to the pull request branch.
3. Wait for the branch header to refresh, then pull.

If the header still shows the warning after you push the fix, open the dialog and click **Pull again**.

Your edits in Omni stay in the branch. They go to the pull request on your next push.

## A commit named 'Normalize model files as Omni writes them' appears on the pull request

**1. What you're seeing**

After you push a commit to the pull request branch from outside Omni, a second commit appears on the pull request with the message `Normalize model files as Omni writes them`.

**2. Why it happens**

Omni compared the model files in your commit with the way Omni writes the same files, and the files differed. Omni rewrote them in its own format so that the pull request matches what a push from Omni writes.

**3. How to fix it**

No action is required. Omni runs its checks again on the normalize commit, and its comment on the pull request says `Omni rewrote the files on this commit to match its serialization format.`

See [The normalize commit](https://docs.omni.co/integrations/git/v2/pull-and-push.md#the-normalize-commit).

## A commit on the base branch doesn't reach the shared model

**1. What you're seeing**

A commit is on the repository's base branch, and the shared model doesn't have its changes. In the model IDE, the dot on the **Shared** badge is red. In GitHub, the commit has a failed `Model: <model_path>` commit status and a comment from Omni.

**2. Why it happens**

Omni runs the build and validation checks on each base branch commit before it pulls the commit. A check set to `error` failed. See [Checks on base branch commits](https://docs.omni.co/integrations/git/v2/merging.md#checks-on-base-branch-commits).

**3. How to fix it**

1. In GitHub, open the commit and read Omni's comment to find the failed check and what it found.
2. Fix the model files and push the fix to the base branch. Omni checks the new commit and pulls it when the checks pass.

## An edit made in the shared model was replaced by a change from git

**1. What you're seeing**

An edit that someone made directly in the shared model is gone after a pull request merged, after a commit to the base branch, or after you clicked **Test git connection**. The sync message may include `replaced edits made in the shared model that conflicted with them`.

**2. Why it happens**

The edit wasn't in git yet, and a change on the base branch conflicted with it. When Omni pulls the base branch into the shared model, git's version replaces a conflicting edit. See [Merges and the base branch](https://docs.omni.co/integrations/git/v2/merging.md).

**3. How to fix it**

1. Open the model's [history](https://docs.omni.co/modeling/develop/history.md).
2. Find the version whose description ends with `replaced edits made in the shared model that conflicted with it`.
3. Compare it with the version before it to see the replaced edit.
4. Make the edit again on a branch and merge it through a pull request.

## Edits made in the shared model aren't committed to git

**1. What you're seeing**

You promote a change or merge a branch in Omni, and the change doesn't appear on the repository's base branch.

**2. Why it happens**

The base branch has commits to the model's files that the shared model doesn't have. Omni delays its own commit so that it doesn't write over them. This usually means that Omni didn't receive a **Push** event for a commit to the base branch.

**3. How to fix it**

1. In the model's git settings, click **Test git connection**. Omni pulls the base branch into the shared model and then commits the shared model's edits.
2. In GitHub, confirm that the Omni webhook sends the **Push** event. See [Commits to the base branch don't appear in Omni](#commits-to-the-base-branch-dont-appear-in-omni).

## A merged pull request appears in model history without a link to the pull request

**1. What you're seeing**

After a pull request merges, the shared model's history shows a version described as `Loaded main into the shared model`, where `main` is your base branch. The description doesn't name the pull request.

**2. Why it happens**

GitHub sends Omni a push event and a merge event for a merged pull request. Omni handled the push event first, so the version is labeled as a push. The shared model has the pull request's changes.

**3. How to fix it**

No action is required. To find the pull request, open the base branch's commit history in GitHub.

## 'The conflict is resolved on its branch but not merged' when pushing

**1. What you're seeing**

A push from the model IDE doesn't update the pull request. Omni shows **The conflict is resolved on its branch but not merged. Merge its pull request, or open one, then push again.**

A commit through the API returns a `409` response with a `conflict_pull_request_url` value.

**2. Why it happens**

Someone committed a resolution to the conflict branch (`omni/<branch>/<commit>`), and that branch hasn't merged into your branch yet. Omni blocks pushes so that it can't write over the resolution.

**3. How to fix it**

1. In GitHub, open the pull request from the conflict branch into your branch. If the conflict branch doesn't have a pull request, open one.
2. Merge the pull request.
3. In the model IDE, pull, then push again.

See [Resolve conflicts](https://docs.omni.co/integrations/git/v2/conflicts.md) for the full flow.

## A conflict stays after the conflict pull request is closed

**1. What you're seeing**

You closed the conflict pull request without merging it. The model IDE still shows **Resolve conflicts**.

**2. Why it happens**

Omni treats a conflict as resolved when the conflict pull request merges. A closed pull request leaves the conflict unresolved. If the conflict branch also has a resolution commit, Omni blocks pushes until that resolution merges.

**3. How to fix it**

Do one of the following:

* **Finish the resolution.** Reopen the conflict pull request and merge it. Then pull in the model IDE.
* **Start over.** Delete the conflict branch (`omni/<branch>/<commit>`) in GitHub to discard the resolution. Then click **Resolve conflicts** in the model IDE to publish Omni's version again.
