title: Is it possible to connect multiple local folders to one repository in Github?
body: <h3>Question</h3>
  <p>I have two different folders with different paths and I want to link them to the same repository. For illustration purposes, the two different folders are</p>
  <pre><code>Folder 1: C:\Users\Tea\Folder1
  Folder 2: C:\Users\Tea\Folder2
  </code></pre>
  <p>Folder 1 was originally linked to my repository but I wanted to link Folder 2 to the repository too so I can push a file from there as well.</p>
  <h3>Here's what I tried</h3>
  <pre><code>cd C:\Users\Tea\Folder2
  git init
  git add .
  git commit -m &quot;initial commit from Folder 2&quot;
  git remote set-url origin --push --add http://github.com/&lt;my username and repository&gt; 
  </code></pre>
  <p>The last line was done according to this post: <a href="https://stackoverflow.com/questions/849308/pull-push-from-multiple-remote-locations/12795747#12795747">pull/push from multiple remote locations</a></p>
  <p>However, I got an error message when doing</p>
  <pre><code>git push origin master
  </code></pre>
  <p>asking me to do a git fetch. More specifically it wrote:</p>
  <pre><code>! [ rejected ] master -&gt; master(fetch first)
  error: failed to push some refs to 'https://github.com/...'
  hint: Updates were rejected because the remote contains work that you do
  hint: not have locally. This is usually caused by another repository pushing
  hint: to the same ref. You may want to first integrate the remote changes
  hint: (e.g., 'git pull...') before pushing again
  </code></pre>
  <p>So I did <code>git pull origin master</code> and got these messages instead</p>
  <pre><code>hint: Updates were rejected because the tip of your current branch is behind
  hint: its remote counterpart. Integrate the remote changes (e.g.
  hint: 'git pull ...') before pushing again.
  hint: See the 'Note about fast-forwards' in 'git push --help' for details.
  </code></pre>
  <p>I tried merging but got</p>
  <pre><code>fatal: refusing to merge unrelated histories
  </code></pre>
  <p>so I decided to do</p>
  <pre><code>git push -f origin &lt;branch&gt;
  </code></pre>
  <p>according to <a href="https://stackoverflow.com/questions/10298291/cannot-push-to-github-keeps-saying-need-merge">Cannot push to GitHub - keeps saying need merge</a>
  without knowing exactly what &quot;losing all commits&quot; meant (I thought it just meant that the current commit messages would be lost).</p>
  <p>Turns out this was a bad decision on my part since the new folder I linked to the git repository just replaced my old git repository entirely (i.e. all the old files are now gone).</p>
  <p><strong>tl;dr: How do I link two separate folders to one Github repository?</strong>
  Thanks in advance!</p>