Using a Git Repository

Oxygen XML Web Author includes a Git plugin that allows you to edit files stored in a Git repository (including GitHub integrations). The procedure in this topic assumes that this plugin is enabled in your installation of Oxygen XML Web Author.

Open or Create a File Stored in a Git Repository

To open a file stored in a Git repository, use the dedicated Git icon () in the Open section of the main dashboard (a Choose File dialog box will be displayed that allows you to browse for the file). To create a new file, use the dedicated Git icon () in the New section (a Choose Template dialog box will be displayed). For information, see Creating or Opening Documents.

If your connection has not yet been configured, a dialog box will be displayed that provides instructions for configuring and selecting the URL for the connection. For more information, see Configure a Plugin.

Commit a File to a Git Repository

To commit a file to a Git repository, select the Commit on Git action on the toolbar (or use the Ctrl + S (Command + S on OS X) shortcut). A dialog box will be opened that allows you to enter a commit message and choose the branch for which the commit will be processed (you can also edit the name of the branch in this dialog box). It also includes a Choose a previously entered comment drop-down menu that allows you to select a previously used commit message.
  • When committing on a branch that is different from the branch of the currently opened document and the branch does not exist, Oxygen XML Web Author will attempt to create it.
  • If someone else has committed the current document since you last opened it (causing conflicts), a Commit Status confirmation dialog box will appear.

    Figure: Commit Status Dialog Box

    The Commit Status dialog box allows you to choose the following options:
    • Click here link - You can click the link at the top of the dialog box to see the difference between the two commits.
    • Merge and commit - Merges your changes with versions that were committed by other people and commits the merged changes.
    • Commit on a new branch - Creates a new branch that contains your version of the document so that you can merge the changes at a later time, after the conflicts have been solved.
    • Commit only my changes - Commits your changes regardless of whether or not there was a conflict, and the changes made by the other user are lost.
    • Cancel - Cancels the operation and your changes are not committed to the repository. Before canceling, you could click the link at the top to see the differences, correct the conflicts manually, and then commit afterwards using the Commit only my changes option.

Committing to a Repository Without Access

If you try to commit a file on a repository that you do not have access to, a Commit Error dialog box is displayed. It warns you that continuing will commit the file to a new branch and allows you to specify the details for an automatic pull request (assuming the Create Pull Request automatically option is not disabled). The Pull Request Title field allows you to specify a title for the pull request and the Message field allows you to add and optional description.

Figure: Commit Error Dialog Box

When you tap or click the Commit button, the Git connector will automatically do the following:
  • Fork the project into your account, if it is not already.
  • Create a new branch from the edited branch.
  • Commit your changes on this newly created branch.
  • Create a pull request from your newly created branch to the originally edited branch.
  • Switch the editor to your branch so further save operations will just add new commits to your branch, thus updating the pull request with new changes.