title: Getting local master to track origin master
body: <p>My git repo is in a bit of a weird place right now, so let me explain how I got here...</p>
  
  <ol>
  <li><code>cd /var</code></li>
  <li><code>git clone https://github.com/..... www</code></li>
  <li><code>cd www</code></li>
  <li>Realize I want to put the site in a sub-directory of www</li>
  <li><code>mkdir my-site</code></li>
  <li><code>mv !(my-site) my-site</code></li>
  <li><code>cd my-site</code></li>
  </ol>
  
  <p>Now when I run <code>git status</code>, it claims that <strong>every single file</strong> has been deleted, and that the <code>my-site</code> folder is not being tracked. Kind of makes sense: I moved <strong>every single file</strong></p>
  
  <p>To try and correct this I did the following:</p>
  
  <ol>
  <li><code>git init</code> -- create a new repo in "my-site"</li>
  <li><code>git remote add origin https://github.com/.....</code> -- make this repo a "clone" of my origin</li>
  <li><code>git fetch --all</code> -- make sure I'm aware of the most recent commits</li>
  <li><code>git branch -u origin/master master</code> -- tell my local master to track origin master</li>
  </ol>
  
  <p>When I did this I got the following error:</p>
  
  <pre><code>fatal: branch 'master' does not exist
  </code></pre>
  
  <p>Running <code>git status</code> gives me the following:</p>
  
  <pre><code>On branch master
  
  Initial commit
  
  Untracked files:
    (use "git add &lt;file&gt;..." to include in what will be committed)
  
          ...
  
  nothing added to commit but untracked files present (use "git add" to track)
  </code></pre>
  
  <p>Running <code>git branch -a</code> gives me:</p>
  
  <pre><code>remotes/origin/master
  </code></pre>
  
  <p>So I know I'm on a local master and I know a remote master exists, but I can't seem to tie the two together.</p>