title: homebrew cannot update and I cannot add a git repository
body: <p>Pretty much what the title says. I'm trying to update homebrew using </p>
  
  <pre><code>brew update
  </code></pre>
  
  <p>and I always get the error message</p>
  
  <pre><code>$ brew update
  fatal: Not a git repository (or any of the parent directories): .git
  fatal: Not a git repository (or any of the parent directories): .git
  Error: Failure while executing: git checkout -q master
  </code></pre>
  
  <p>The brew doctor command output is as follows:</p>
  
  <pre><code>$ brew doctor
  Warning: Missing git origin remote.
  
  Without a correctly configured origin, Homebrew won't update
  properly. You can solve this by adding the Homebrew remote:
    cd /usr/local
    git remote add origin https://github.com/Homebrew/homebrew.git
  fatal: Not a git repository (or any of the parent directories): .git
  </code></pre>
  
  <p>When I run</p>
  
  <pre><code>cd /usr/local
  git remote add origin https://github.com/Homebrew/homebrew.git
  </code></pre>
  
  <p>I get</p>
  
  <pre><code>$ cd /usr/local
  $ git remote add origin https://github.com/Homebrew/homebrew.git
  fatal: Not a git repository (or any of the parent directories): .git
  </code></pre>
  
  <p>What can I do to get rid of this problem? It seems git doesn't recognize homebrew's repository, put what should I use instead of this suggested one?</p>