您如何将 Postman 与 git 存储库同步如何将、Postman、git

2023-09-07 10:30:15 作者:缺爱的孤独患者

我想知道如何将 Postman 配置与 git 存储库同步.

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

我知道您可以从 Postman 导出和导入文件夹 - 这没问题 - 但我想知道是否有更轻松的方法.

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

推荐答案

我不完全确定你是如何尝试使用它的,但有几个选项是:

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

使用名为 newman 的插件 cli.您可以使用 newman 从 URL 或本地文件运行集合

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

然后,如果您将远程 url 作为 git 存储库的一部分,它显然会随着每次提交/拉取而更新/更改

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

请谨慎尝试,仅当您对该过程感到满意时,这也可能不符合他们的使用条款,所以我不建议您在没有先研究的情况下尝试它

如果您可以找到保存 Postman 集合的目录,您可以使用命令行从您机器上的 git 存储库到您需要链接的目录或特定文件创建一个硬链接.每当您更改源文件时,Postman 配置中的源文件都会更改.

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.

完成此操作的方式取决于您使用的系统和 Postman 的版本.

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

 
精彩推荐