How to share the Postman collection and changes made in the collection by using GitHub?

Ceren Çakır
5 min readFeb 26, 2024

--

I’m using here: Postman, IntelliJ IDEA, GitHub

Before starting, you need to have a Postman collection, you need to know Git to understand what I did here, and you need to have a tool like IntelliJ IDEA.

At first, we need a Git repository. Let’s create a repository.

Once this has been created, all I have to do is go to clone and download, and I have to get the address where this is located. So I can easily copy this. And I’m gonna use IntelliJ IDEA to manage this repository. But you can use any other tools that you like.

Now, I open IntelliJ IDEA then I click on Get from VCS and paste the URL, then Clone it.

After cloning the project, it’s displayed as empty at first. Because we have not done anything yet.

Let’s go to Postman. So what I will do with this collection is I will click these three dots and I’ll click the Export option from the menu that appeared here.

And I export the collection with the latest version that is being recommended.

Now, all I have to do is to locate the folder that we have checked out previously.

Then go to Postman collection, this is the first version of my requests and let’s say we want to make minor changes to the name of the first request. It’s now Get member’s all boards * (map) and we’ll change it to Get member’s all boards * (map1)

Then go to IntelliJ IDEA, and change the name of it as you can see below

Then commit and push by adding a comment below

After pushing, you need to see the info at the bottom of the page.

Go to GitHub, and refresh the page. You need to see the JSON file with the comment anymore.

Then go to Postman, click import button, and select the file from where we saved it.

I will select import as Copy to see the differences clearly

2s

So that’s it. We can see the initial name of the request and the last version of the name after we change it.

Now, let’s imagine that somebody else made a change to this file, and I’ll simulate it by directly changing it inside GitHub. You will be able to easily make a change here. So you’ll see here that the name of a request is

Get member’s all boards * (map1)

So let’s call this Get member’s all boards * (map2). Then click the commit changes button

Now, it doesn’t matter who has to do it. Any user who now wants to have the latest version or to make changes to this collection should do the following steps.

And the first step would be to pull the latest changes from the repository. So I will pull the latest changes.

And now if I look at the differences by clicking “show diff” which I signed below

So left was the first version, and the right one is just a minor change that we did by using GitHub.

Now, we can see the last version of the request name.

Now, if I go back to Postman. We have pulled these changes and still don’t have the latest version here in Postman. So what we need to do is to hit this Import button and we are gonna import a file. Then follow the same steps as I explained step by step above.

So finally, we can see the latest version of the request name in Postman.

As soon as you make another change, you’ll be able to go through the same process again. So you’ll export the collection as a file, you will commit it, you’ll have to push it, and everybody else will have to pull these changes and manually import them again.

So this is how you can use Git with your Postman collections.

Thanks!

You can follow me for more on GitHub, LinkedIn, and Medium

--

--

Ceren Çakır
Ceren Çakır

No responses yet