title: Script to set multiple insteadOf cases in gitconfig
body: <p>I need a script that will ensure the following content on the <code>.gitconfig</code> file:</p>
  <pre><code>[url &quot;git@&lt;IP addr&gt;:&quot;]
      insteadOf = https://&lt;IP addr&gt;/
      insteadOf = https://&lt;domain name&gt;/
      insteadOf = git@&lt;domain name&gt;:
  </code></pre>
  <p>This is meant to ensure that the user will always clone with SSH and use the IP address instead of the HTTP address (both in IP or domain form) and instead of ssh using the domain name.</p>
  <p>However, using the following code:</p>
  <pre><code>git config --global url.git@&lt;IP addr&gt;:.insteadOf https://&lt;IP addr&gt;/ --replace-all
  git config --global url.git@&lt;IP addr&gt;:.insteadOf https://&lt;domain name&gt;/ --add
  git config --global url.git@&lt;IP addr&gt;:.insteadOf git@&lt;domain name&gt;: --add
  </code></pre>
  <p>This works fine, but once the script is run again, it reprints the lines in the .gitconfig file, which over time will make the file too large and git speed too slow. I've tried all combinations of flags <code>--replace-all</code> <code>--add</code> and so on. They either stack up the file or issue a warning which I also cannot tolerate due to project requirements.</p>
  <blockquote>
  <p><strong>Is there any syntax to add the three lines at once and do nothing if they're already there?</strong></p>
  </blockquote>