Git v2 is available for GitHub repositories. To have Git v2 turned on for your organization, reach out to Omni support.
How it works
Omni works like a clone of your repository, and the shared model is its copy of the base branch. Omni pulls the base branch into the shared model when:- A pull request merges
- Someone pushes a commit directly to the base branch
- You click Test git connection in the model’s git settings, or call the sync API
- If an edit in the shared model and a commit in git change the same thing, Omni uses git’s version. You can find the replaced edit in the model’s history.
- Every other edit in the shared model stays.
Commits Omni hasn’t pulled
Before Omni commits the shared model to the base branch, it checks whether the base branch has commits to the model’s files that the shared model doesn’t have. If the commit would write over any of those files, Omni commits nothing for that model and leaves the base branch as it is. This check applies to every commit Omni makes to the base branch, including the ones that follow a promotion, a branch merge in Omni, and a schema refresh. Omni makes the delayed commit after it pulls the base branch, which happens on the next push, pull request merge, or sync.Requirements
- A repository with Use v2 Git integration turned on. See Set up Git v2 with GitHub.
- A webhook that sends the Pull request and Push events. Omni uses the Push event to learn about commits made directly to the base branch.
When a pull request merges
When a pull request that has an Omni branch merges, Omni pulls the latest commit on the base branch into the shared model. The shared model then has everything on the base branch, including commits from other pull requests that merged since Omni last read the repository. For a pull request that has no Omni branch, Omni pulls the merge when GitHub sends the Push event for it. What this means for the pull request’s Omni branch:- Pushed changes reach the shared model. Edits on the Omni branch that you didn’t push to the pull request stay on the branch.
- Omni deletes the branch when it has no unpushed edits. A branch with edits newer than its latest commit is kept, with its pull request link cleared, so you can open a new pull request for those edits.
When someone commits directly to the base branch
When GitHub sends a Push event for the base branch, Omni does the following:1
Pulls the pushed changes
Omni pulls the base branch into the shared model. Git’s version replaces any conflicting edit made in the shared model.
2
Commits the shared model's own edits
If the shared model has edits that aren’t in git yet, Omni commits them to the base branch on top of the pushed commit.When the repository’s settings stop Omni from committing directly to the base branch, the edits stay in the shared model until a pull request sends them to git.
Which pushes Omni pulls
Omni pulls a push when all the following are true:- The push is to the model’s base branch
- The push changes a file in the model’s folder or its extensions folder
- The shared model doesn’t have the pushed commit yet
- Pushes to other branches
- Pushes of tags and pushes that delete a branch
- Pushes that don’t change the model’s files
- Pushes of a commit the shared model already has, such as a commit Omni made itself
Sync from git settings
The Test git connection button in the model’s git settings syncs the shared model with the repository. On Git v2, when the base branch has changes to the model’s files that the shared model doesn’t have, the sync:- Pulls the base branch into the shared model. Git’s version replaces any conflicting edit.
- Commits the shared model’s own edits to the base branch.
Sync messages
Omni shows a message after the sync. When Omni pulled the base branch, the message includes one of these sentences:
The full set of messages:
Checks on base branch commits
Before Omni pulls a commit from the base branch into the shared model, it runs the build and validation checks on the commit. Omni pulls the commit when the checks pass. If a check set toerror fails, Omni leaves the shared model as it was and posts a failed Model: <model_path> commit status. A comment on the commit lists each check and what it found. Push a fix to the base branch, and Omni checks the new commit.
The sync check applies to pull requests and doesn’t run on base branch commits. To set a different severity for base branch commits, see default_branch.
See the base branch state in the model IDE
For a shared model on Git v2, the Shared badge next to the model’s name shows the base branch and a colored dot:
Click the badge to see the latest commit, whether it passed, and the commit the shared model has.
Model history
Each pull creates a version in the shared model’s history. The version’s description shows what started the pull:
When git’s version replaced an edit made in the shared model, the description ends with a second part. For a base branch named
main:
Limitations
- A merged pull request can appear in history as a push. When a pull request merges, GitHub sends Omni a push event and a merge event. If Omni handles the push first, the history version reads
Loaded main into the shared modeland has no link to the pull request. The merge event then deletes or keeps the Omni branch as described in When a pull request merges. - Pushes over 25 MB. GitHub doesn’t deliver a webhook event with a payload over 25 MB, so Omni doesn’t receive the push. Click Test git connection to pull the base branch.
- A delayed commit shows no message. When Omni delays a commit after a promotion or a branch merge in Omni because the base branch is ahead, Omni doesn’t show a message. With the Push event turned on, Omni pulls the base branch soon after each push, so a delayed commit is rare.

