Skip to Content
Native GitMake Changes and Commits

Making Changes and Commits

APIGit provides an intuitive interface for editing files and committing changes to your API repositories. This guide walks you through the process of making changes and creating commits.

Step 1: Select a File and Enter Edit Mode

In your API Repository, navigate to the file you want to edit. Different file types will open in specialized visual editors based on the file’s content and purpose.

For example, to edit an API Specification:

  1. Navigate to the API & Documents tab
  2. Select the specification file
  3. Click the “Edit” icon button in the bottom left corner to enter the API Spec editor

Specification open in the viewer, with the Edit button in the bottom left corner

Within the editor, you can switch between different views to facilitate your editing process. For an API specification the views are Form, Code, Diff, Governance and Preview; for a mock script they are Code and Diff.

API Spec editor in the Form view, with the paths of the specification in the sidebar

Step 2: Review Your Changes

Your edits are kept as local drafts until you commit them, so you can change several files and commit them together. A note next to the view tabs shows the number of uncommitted files.

After completing your edits, switch to the Diff view to review the changes before committing. This allows you to verify that only intended modifications are included in your commit.

Diff view of a changed file, with a note showing one uncommitted file change

Open the Changes tab in the sidebar, or click Review next to the note, to see every changed file.

Changes tab listing one changed file, with the Commit button and Discard all drafts

From this tab you can:

  • Tick the files to include in the commit, or use All changes
  • Revert one file, or all of them, with the undo icon next to it
  • Remove every draft in this view with Discard all drafts

Step 3: Submit Your Changes

When you’re satisfied with your changes:

  1. Click the Commit button in the Changes tab
  2. Choose Commit directly to the current branch, or Create a new branch for this commit and enter its name
  3. Add a descriptive commit message that explains the purpose of your changes
  4. Click Commit to commit your changes to the APIGit backend

Commit dialog with the changed files, the branch choice and the commit message

Once successfully committed, a new commit record will be generated in your repository’s history, just like a regular Git commit.

Leaving Edit Mode with Uncommitted Changes

If you click Exit edit while you have uncommitted changes, APIGit asks what to do with them: Exit with saved draft keeps your drafts so you can pick up where you left off, and Discard draft and exit removes them. Switching to another branch while editing asks the same question, with Switch with saved draft and Discard changes and switch.

Handling Conflicts

If the file changed on the server since you started editing, APIGit tries to merge the changes for you. If there are conflicts (for instance, someone else modified the same lines), the Commit button stays disabled and APIGit shows a banner with a Resolve button. You can:

  1. Click Resolve to open the Review and resolve conflicts with HEAD dialog
  2. Make necessary adjustments to resolve the conflicts, and click Save changes
  3. Commit again

The banner also covers files that were deleted on the server, or added there with the same name as yours. View on server shows the version on the server.

This workflow ensures that all changes are properly tracked and integrated into your repository’s history.

Last updated on