title: npm install of custom branch fails due to local changes
body: <p>I'm quite baffled by the following situation:</p>
  
  <ol>
  <li>I forked a git repository, created a new branch, made some changes and pushed to github.</li>
  <li>I changed the dependency for the package in the <code>package.json</code> of a node.js project I'm working on to point to the branch, i.e. <code>&lt;dependency&gt;: "https://github.com/&lt;myUsername&gt;/&lt;forkedRepo&gt;.git#&lt;branch&gt;"</code></li>
  <li>I execute <code>npm install</code></li>
  </ol>
  
  <p>This results in the following error message:</p>
  
  <p><code>
  npm ERR! git checkout 7275f0542b4efbf72f8faaacd6bec5b8d9b3c1a5: error: Your local changes to the following files would be overwritten by checkout: ...(some files)
  </code></p>
  
  <p>There are two peculiar things about this:</p>
  
  <ol>
  <li>Why should an npm install interfere with my local repository?</li>
  <li>My local repository is clean, i.e. has the same state as the one on github: 
  <code>
  git status
  On branch &lt;branchName&gt;
  nothing to commit, working directory clean
  </code></li>
  </ol>
  
  <p>Stuff I already tried: <em>(unsuccessful)</em></p>
  
  <ul>
  <li><code>npm cache clear</code></li>
  <li><code>npm cache clear -g</code></li>
  <li>removed <code>node_modules</code> from the node.js project <em>(and now I can't get it back, because <code>npm install</code> fails)</em></li>
  </ul>
  
  <p>Does anyone have any ideas on how to resolve this?</p>