title: A locally ignored file was updated on remote; can't checkout to remote branch now
body: <p>Consider the following scenario:</p>
  
  <p>I have the following in my <code>.gitignore</code>:</p>
  
  <pre><code>files/dependency/config.lua
  </code></pre>
  
  <p>But since the file used to exist before adding it to gitignore, it was being tracked. I updated my index and removed the file manually <a href="https://stackoverflow.com/q/6317169/1190388">following this question</a>. Now, one of my colleague updated this file on remote server.</p>
  
  <p>When I try to checkout to remote branch, it shows:</p>
  
  <blockquote>
    <p>error: Your local changes to the following files would be overwritten
    by checkout:</p>
  
  <pre><code>files/dependency/config.lua
  </code></pre>
    
    <p>Please, commit your changes or stash them before you can switch branches.</p>
    
    <p>Aborting</p>
  </blockquote>
  
  <p>So, I read about it; and most of the answers I found tell you to use <code>git stash</code>. Since I don't have any changes made on local repository, I can not stash them.</p>
  
  <p>I used the <code>--force</code> option to checkout, but it also returns with an error:</p>
  
  <pre><code>git checkout --force -B myBranch remote/branchname
  error: Entry 'files/dependency/config.lua' not uptodate. Cannot merge.
  </code></pre>
  
  <p>Here, I'd paste my terminal:</p>
  
  <pre><code>┌─[hjpotter92:HEDWIG]─[fooDir]─[06:46 PM] (master u=)
  └──$ git status
  On branch master
  Your branch is up-to-date with 'origin/master'.
  
  nothing to commit, working directory clean
  ┌─[hjpotter92:HEDWIG]─[fooDir]─[06:39 PM] (master u=)
  └──$ git checkout -b myBranch remote/branchname
  error: Your local changes to the following files would be overwritten by checkout:
          files/dependency/config.lua
  Please, commit your changes or stash them before you can switch branches.
  Aborting
  ┌─[×]─[hjpotter92:HEDWIG]─[fooDir]─[06:39 PM] (master u=)
  └──$ git stash
  No local changes to save
  ┌─[hjpotter92:HEDWIG]─[fooDir]─[06:39 PM] (master u=)
  └──$ git checkout -b myBranch remote/branchname
  error: Your local changes to the following files would be overwritten by checkout:
          files/dependency/config.lua
  Please, commit your changes or stash them before you can switch branches.
  Aborting
  ┌─[×]─[hjpotter92:HEDWIG]─[fooDir]─[06:39 PM] (master u=)
  └──$ git checkout --force -b myBranch remote/branchname
  error: Entry 'files/dependency/config.lua' not uptodate. Cannot merge.
  </code></pre>
  
  <h3>Question:</h3>
  
  <p>Is there some way to checkout the remote branch and then either force ignoring the file <code>files/dependency/config.lua</code> whenever someone pulls in my changes or something similar?</p>