title: What is the difference between "git remote add origin", " set-url origin" and config...?
body: <p>There seem to be at least 3 ways to do what sounds as the same thing. </p>
  
  <pre><code># 1. git remote add origin https://x@bitbucket.org/x/y.git
  # 2. git remote set-url origin ssh://git@bitbucket.org/x/y.git 
  # 3. git config --local remote.origin.url ssh://git@bitbucket.org/x/y.git
  </code></pre>
  
  <ul>
  <li><strong>What are their differences?</strong></li>
  <li>What is the preferred or standard way?</li>
  </ul>
  
  <p>Note: This may seem as a duplicate of <a href="https://stackoverflow.com/questions/42830557/git-remote-add-origin-vs-remote-set-url-origin">THIS</a> but those answers are incomplete and do not explain the difference of changing the URL vs the "remote"?</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>Doing some further googling: From <a href="https://stackoverflow.com/a/20928583/1147688">this</a> SO answer:</p>
  
  <blockquote>
    <p>A <code>remote</code> in git is basically a bookmark for a different repository
    from which you may wish to pull or push code. The bookmarked
    repository may be on your local computer in a different folder, on
    remote server, or it may even be the repository itself... but the
    simplest analogy is a bookmark. The repository doesn't even have to be
    a version of your repository, it may even be a completely unrelated
    repository.</p>
  </blockquote>
  
  <p>and <a href="https://stackoverflow.com/a/22712683/1147688">this</a>: </p>
  
  <blockquote>
    <p><code>origin</code> is <strong>not</strong> the remote repository name. It is rather a local alias set as a key for the remote repository URL. </p>
  </blockquote>