Note: Sync with Git applies to users subscribed to Team plan and above, refer to pricing.
Sync with Git is a built-in feature for Design Documents and Collections that enables you to configure your repository to an external Git version control system like GitHub or Gitlab.
Pushing to a remote Git repository creates the .insomnia
directory that can also be used with Inso CLI.
Within a Team/Enterprise organization, you can clone a remote from Git via the Create dropdown on the Dashboard view.
You will be prompted to fill out remote Repository Settings to gain remote access.
The remote repository must contain the root .insomnia
directory, otherwise it will create an empty Design Document by default.
Note: This section assumes that you already have an empty remote Git repository.
Within a Team/Enterprise organization, you can convert an existing Insomnia Synced Collection/Design Document to use Git Sync instead.
This can be done clicking on the Switch to Git Repository button on the Sync dropdown.
A Configure Repository modal will open.
Configure it according to your Git Sync setup and press “Sync”.
When configuring a remote repository, you can chose to connect with GitHub or GitLab, or manually set up a remote repository.
Click Authorize to allow Insomnia to connect with your GitLab account.
If successful, you will be redirected to the Insomnia website with the message “Successfully authenticated Insomnia”.
Return to the Insomnia app and wait for sync to finish.
app.insomnia.rest
into the Insomnia app, then click Sync.Note: You may fail to set up Git Sync properly due to not enough or the wrong types of Git permissions.
Find instructions on how to create a personal access token or app password on the following platforms:
public_repo
when creating your token.repo
when creating your token.api
when creating your personal access token.Read
and Write
in the Repository
options when creating your app password.Once complete, click Done and the repository settings will be persisted for future operations. The author details and token can be updated as needed.
When working with Git, it’s good practice to make changes in separate branches. This has two benefits:
Note: Remote branches will only appear if they do not already exist locally.
Commit your changes via the branch dropdown menu. You’ll be prompted to add a descriptive message as your commit message.
Pushing your changes to your remote repository for the first time creates the .insomnia
directory, which you can use with the Inso CLI.
Note: If you’d like to push to an alternative branch than the default, click on the branch dropdown menu. Select Branches, and add your desired branch name.
Commits and branches only exist locally when created. A push needs to be done to share the commits and history of a branch remotely. If pushing fails, you will be given the option to force push.
The push or force push operation can fail for many reasons, and logs will be presented in the Developer Console prefixed with git-event
with further debugging information. A likely cause is that your user does not have permissions to push to a protected branch.
For instance, with GitLab, the main/master branch is protected by default, and those with the developer role are unable to push directly to it. In that case, push to a separate branch and create a pull request, or update the permissions for your user on the repository.
If a collaborator makes a change to the remote repository, pull the changes to access the work locally. Click the branch dropdown menu in a Document and then Pull. Any incoming changes will be merged to your local machine.
Git sync does not currently support the ability to resolve conflicts within the application. If changes were made locally and remotely, a pull may fail.
Here are some strategies to help with conflicts:
Sign out of a synced Git management account.
The Configure Repository box will no longer list the account that was signed out in its list of configured accounts.