title: How can I link an existing directory to an existing git repo
body: <p>I have a folder foo, without any git integration</p>
  
  <pre><code>/foo
      file1.txt
      file2.txt
  </code></pre>
  
  <p>and my own repo, which already has several branches, including master </p>
  
  <pre><code>https://my-fake-repo
  </code></pre>
  
  <p>I would like to link foo to the master at <a href="https://my-fake-repo" rel="noreferrer">https://my-fake-repo</a>, such that if I then ran 'git diff', I would see the differences between /foo and <a href="https://my-fake-repo" rel="noreferrer">https://my-fake-repo</a>'s master.</p>
  
  <p>I want the equivalent of checking out <a href="https://my-fake-repo" rel="noreferrer">https://my-fake-repo</a>, deleting the contents, and pasting the files from /foo into it. I was hoping I could do this with just some Git commands, but i'm not familiar enough with Git and my research is failing. I attempted to do something like:</p>
  
  <pre><code>cd /foo
  git init
  git remote add origin https://my-fake-repo
  git branch master --set-upstream-to origin/master
  </code></pre>
  
  <p>but master doesn't exist yet, so it doesn't work...</p>