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