Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you sync Postman with a git repository

Tags:

postman

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.

like image 800
meh-uk Avatar asked Dec 05 '16 15:12

meh-uk


People also ask

How do I import Postman to GitHub?

In Postman, select Import > Code repository > GitHub. Confirm your GitHub account and Authorize postmanlabs to access your repositories. In Postman, select your GitHub organization, repository, and branch, then select Continue. Select the files you want to import into Postman.

How do I sync my Postman collection?

Postman indicates the sync state of your workspace with the sync icon in the footer. Hover over the sync icon to see more information about your connection and sync status. Offline means that you aren't connected to the Postman servers. This may mean that your computer isn't connected to the internet.


Video Answer


2 Answers

I'm not exactly sure how you're trying to use this, but a few options would be:

First Option

to use their addon cli called newman. You can run collections from a URL or Local file with newman using

newman run http://some.url.here 

Then if you make the remote url a part of a git repository it would obviously update/change with each commit/pull

Second Option

Try this with extreme caution and only if you feel comfortable with the process, also this may not be compliant with their terms of use so I don't suggest you try it without first some research

If you can find the directory in which the Postman collections are held, you could create a hard link with the command line from a git repository on your machine to the directory or specific file you need to link. Whenever you change the source file the one in the Postman config will change.

The way in which you accomplish this will depend on the system you use and version of Postman.

like image 164
DanielC Avatar answered Sep 19 '22 05:09

DanielC


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.
like image 35
J.Lin Avatar answered Sep 22 '22 05:09

J.Lin