Skip to main content
Git v2 is available for GitHub repositories. To have Git v2 turned on for your organization, reach out to Omni support.
On a repository that uses Git v2, you move changes between an Omni branch and its pull request yourself.

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.
When a commit waits in git, Omni’s comment on the pull request says:
To bring the commit into the Omni branch, pull it from the branch header. If the Omni branch has edits that you haven’t pushed, the comment says:
Omni pulls a commit for you in these cases:
  • 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
On the shared model, the Shared badge shows the state of the base branch. See See the base branch state in the model IDE.

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.
  1. Open the branch in the model IDE.
  2. Click the down arrow in the branch header, or click Branch options > Pull from git.
The pull starts immediately. When it finishes, Omni shows one of these messages: 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.
  1. Open the branch in the model IDE.
  2. Click the up arrow in the branch header, or click Branch options > Update pull request.
  3. 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.
Omni commits the branch’s model files to the pull request branch with your commit message. If the branch has no edits of its own and the shared model changed after the branch was last updated, the push starts immediately. Omni merges the shared model’s changes into the pull request with the commit message 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:
The commit keeps the files in git the same as the files a push from Omni writes. The normalize commit counts as a commit to pull, so pull it into the Omni branch. Omni runs its checks again on the normalize commit, and the pull request comment for that commit says:
In some cases Omni finds files that it writes differently and leaves them as they are. The pull request comment then includes Omni writes N files differently but did not rewrite them or Omni writes N files differently but could not rewrite them, gives the reason, and lists the files under Files Omni writes differently.

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.
Click the warning icon or one of the arrows to open the Model files in git have errors dialog. The dialog names the commit and the branch, shows the error, and says:
The model files in commit <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.
The dialog has three buttons:
  • 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.
To make pull and push available again:
  1. Fix the errors in the model files in git.
  2. Push the fix to the pull request branch.
  3. Wait for the branch header to refresh, then pull.

Next steps