Git v2 is available for GitHub repositories. To have Git v2 turned on for your organization, reach out to Omni support.
How it works
- Commits wait in git until you pull them. When someone pushes a commit to the pull request branch in GitHub, Omni runs its checks on the commit and leaves the commit in git.
- Edits stay in Omni until you push them. Your edits are in the Omni branch until you push them to the pull request.
- Omni creates a branch for the pull request. Omni pulls the commit into the new branch.
- The pull request merges. Omni pulls the merge into the shared model.
- The model is in git follower mode. Omni pulls each commit into the Omni branch.
The branch header
The branch header is the header at the top of the model IDE when you work in a branch. After the branch has an open pull request, the header shows these controls:
The same actions are in the Branch options menu, which you open with the dots icon at the left of the header:
- View pull request
- Pull from git
- Update pull request
Automatic refresh
The header reads the branch’s git state when the model IDE loads, and again every 30 seconds while the browser tab is visible. The refresh pauses while the tab is hidden. When you return to the tab, the header reads the state again. When the pull request merges or the Omni branch pulls a new commit from git, the page reloads the branch.Pull changes from git
A pull brings the pull request’s latest commits into the Omni branch.- Open the branch in the model IDE.
- Click the down arrow in the branch header, or click Branch options > Pull from git.
The pull controls are unavailable for a short time while the header refreshes the branch’s git state.
Push changes to the pull request
A push commits your edits in the Omni branch to the pull request branch in GitHub.- Open the branch in the model IDE.
- Click the up arrow in the branch header, or click Branch options > Update pull request.
- If the branch has edits that are not in git, the Update Pull Request dialog opens. Enter a message in the Commit Message field, which is required, and click Update.
Merge changes from base model.
If the pull request has commits that the Omni branch doesn’t have, Omni pulls them first and then pushes.
When the push finishes, Omni shows one of these messages:
When the push control is disabled
The up arrow and the Update pull request menu item are disabled when there is nothing to push. The tooltip shows No local changes. The control becomes available when one of these is true:- The Omni branch has edits that are not in git.
- A document draft on the branch that requires a pull request has new edits.
- The shared model changed after the branch was last updated.
The normalize commit
After a commit from outside Omni arrives on the pull request branch, Omni compares the model files in the commit with the way Omni writes the same files. If the files differ, Omni adds a commit to the pull request branch that rewrites them in Omni’s format. The commit message is:When the model files in git have errors
Omni can’t pull a commit whose model files it can’t read. Examples are a YAML file that doesn’t parse and a property with a value of the wrong type. When the latest commit on the pull request has these errors, the branch header changes:- A warning icon appears next to the arrows.
- The warning icon and both arrows show the tooltip The model files in git have errors. Click for details.
- The Branch options menu shows Model files in git have errors… in place of the pull and push items.
The model files in commitThe dialog has three buttons:<commit>on<branch name>have errors, so this commit can’t be pulled until they are fixed. Fix the errors in git and push. Once Omni sees the new commit, you can pull and push again. Your edits in Omni stay in the branch and go up on the next push.
- View pull request - Opens the pull request in GitHub in a new tab. The pull request comment shows the same error.
- Pull again - Tries the pull again. Use this button if you fixed the errors in git and the header still shows the warning.
- Close - Closes the dialog.
- Fix the errors in the model files in git.
- Push the fix to the pull request branch.
- Wait for the branch header to refresh, then pull.

