title: git: unable to cherry pick
body: <p>I am caught up in a weird loop while trying to cherry pick. Here is what I do, and where the problem is.</p>
  
  <p>I have two branches: <strong>mainline</strong>, and <strong>temp</strong>. I want to cherry-pick a specific commit from mainline to temp. I am doing this like follows.</p>
  
  <ol>
  <li><code>git checkout temp</code></li>
  <li><code>git cherry pick &lt;commit sha&gt;</code></li>
  <li>Now, I get: <code>Segmentation fault: 11</code></li>
  <li><p>I rerun the command from 2), and get: <code>Unable to create ...git/index.lock': File exists</code></p>
  
  <p>====================================================================</p></li>
  <li><p>Now I run <code>rm -f ./.git/index.lock</code></p></li>
  <li><p>Try again <code>git cherry pick &lt;commit sha&gt;</code></p></li>
  <li><p>Now I get this: </p>
  
  <p><em>error: The following untracked working tree files would be overwritten by merge:
      myfile.java</em></p></li>
  </ol>
  
  <p>... for a file which isn't even there. I had it before, but I renamed it, so file under that name is not in a repository.</p>
  
  <ol start="8">
  <li>I run <code>git status</code> and now I see the file <em>myfile.java</em> under <strong>untracked files</strong>. And now it even appears in the editor. I can delete it from the editor, but can't delete it from git repository. I get <code>pathspec 'myfile.java' did not match any files</code></li>
  <li>OK, so I delete the file from editor, rerun <code>cherry-pick</code> and I am back to step <strong>3)</strong>. </li>
  </ol>
  
  <p>What is happening here, and how can I just do my cherry-pick? :D</p>