'How do you sync Postman with a git repository

I'm wondering how you can sync your Postman config with a git repository.

I know you can export and import from Postman to a folder - which is OK - but I wondered if there was something more effortless.



Solution 1:[1]

In addition to exporting and cloud syncing as mentioned in the other answers, there's some other options too.

Postman added a Git sync in Postman app v9 so you can manage version control with forking, merging, and pull requests.

  • There are also built-in integrations to sync your Postman collections with GitHub, with GitLab, and other services for version control. These integrations are for users on the paid plans.
  • Postman also has an API so you can GET and run the latest version of your collection, environment, or whatever using Newman or continuous integration tools or to build your own integration.

Solution 2:[2]

You can use Postman integrations (Home > Integrations) to link Postman to your remote git repository.

The following article explains how to integrate your gitlab repo to Postman: https://learning.postman.com/docs/integrations/available-integrations/gitlab/

Also you can use Postman API versionning to do something similar: https://learning.postman.com/docs/designing-and-developing-your-api/versioning-an-api/

Solution 3:[3]

Postman is not designed for that case. They offer a cloud service which keeps you and your collaborators in sync. You can try their cloud plan for 30 days for free. Check here: https://www.getpostman.com/cloud_trial_faq

Solution 4:[4]

For non-free plans, Postman now (version 9 and up) supports automatic sync of collections with a git repository on several popular git services.

(Again, it's currently only available for paid plans)

See the documentation for how to integrate Postman with GitHub, GitLab and Bitbucket.

The process is roughly:

  • create a dedicated repo on your git provider (e.g. my-postman-collections-repo)
  • create a personal access token for the provider (e.g. GitHub) with the expected scope (e.g. repo and user)
  • define an integration (using postman UI) for each collection you want to be kept in sync

I'm working with the GitHub integration and it works great.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 elkolotfi
Solution 3 Sergej Lopatkin
Solution 4