I work with postman collections in git. Postman does a lot of things well, but the id regeneration that occur when you import are not ideal.
Essentially importing a postman collection, and exporting it again results in a change for every id
e.g. output from git diff-index -p HEAD --
@@ -2404,7 +2412,7 @@
{
"listen": "test",
"script": {
- "id": "60ff37a6-9bf7-4cb4-b142-2da49ff4b86e",
+ "id": "38c15d28-8382-4eaf-ad17-f053c143212d",
"exec": [
"pm.test(\"Status code is 200\", function () {",
" pm.response.to.have.status(200);",
I want to go through the changes in the file and undo all the id changes, but preserve all the others.
Essentially I want to automate running git add -p {my_postman.collection.json}
answering n
to each line with a change to id.
I can see that Git command to programatically add a range of lines of a file to the index? is going the right way as well as Make git automatically remove trailing whitespace before committing as well