Changing Git remote URL updates fetch but not push : <p>I am attempting to change the remote URL of my origin branch in Git. All I want to change is the SSH port. First, listing my remote origins gives me this:</p>

<pre><code>git remote -v


origin  user@example.com:package/name.git (fetch)
origin  user@example.com:package/name.git (push)
</code></pre>

<p>Then, I run the <code>set-url</code> command to change my origin URL:</p>

<pre><code>git remote set-url origin ssh://user@example.com:XX/package/name.git    (XX is my port #)
</code></pre>

<p>Now, I can fetch without issue, but pushing my branch to origin doesn't work, because the push URL didn't change. Listing my remotes again I get this:</p>

<pre><code>git remote -v


origin  ssh://user@example.com:XX/package/name.git (fetch)
origin  user@example.com:package/name.git (push)
</code></pre>

<p><strong>Why did my <code>set-url</code> command only change the fetch URL?</strong></p>
