title: Git: Connect existing local repository to existing remote repository
body: <p>This is probably pretty basic, but I wasn't able to figure it out yet:</p>
  
  <p>I have a PHP project running on two servers, let's refer to those as <code>Live</code> and <code>Staging</code><br>
  Both servers are running the same project obviously but with some changes.<br>
  The project was not on Github when It got into my hands, so that's what I am trying to do first now.<br></p>
  
  <p>I managed to create a new remote repository on Github and connect the <code>Live</code> System to it.<br> (by adding the Github repo as 'origin' on <code>Live</code>)<br>
  <code>git remote add origin https://github.com/path-to-repo/repo.git</code></p>
  
  <p>So the Live System is currently on the <code>master</code>branch and up to date with <code>origin/master</code>which has a history of 4 commits.</p>
  
  <p>Now I am trying to connect the Github Repo on <code>Staging</code> as well</p>
  
  <p>So I did a</p>
  
  <pre><code>git init
  git remote add origin https://github.com/path-to-repo/repo.git
  git remote -v
  
  origin  https://github.com/path-to-repo/repo.git (fetch)
  origin  https://github.com/path-to-repo/repo.git (push)
  
  git fetch
  </code></pre>
  
  <p>Now when I do a git status I see that the repo is still on Initial commit and all files and folders are listed as untracked:</p>
  
  <blockquote>
  <pre><code> root@staging-host:/var/www/html# git status
   On branch master
  
   Initial commit
  
   Untracked files:   (use "git add &lt;file&gt;..." to include in what will be
   committed)
  
           .htaccess
           README.md
           _index.html
           api/
           app/
           composer.json
           global/
           index.php
           package-lock.json
           package.json
           phpinfo.php
           system/
           vendor/
           view/
  </code></pre>
  </blockquote>
  
  <p>How can I check for local changes compared to the last commit in <code>origin/master</code><br>
  I don't want to loose any of the local changes but also not to commit or push anything<br>
  I need to check the diff first before I decide file by file what to commit and what to reset</p>