title: Entirely remove file from local Git repo and GitLab, leaving local file in place
body: <p>I accidentally managed to commit a file that contains passwords, and push the result into GitLab. The project is private, and the passwords aren't actually important, but I want to remove all trace of them from GitLab, and from my local repo, though I need the files to continue to exist on the local filesystem.</p>
  <p>So far, I did a git `rm --cached ' but I'm not sure if that really removed all trace of the file in the repo, and it has the side effect that now I can't do a push with the error &quot;Updates were rejected because the remote contains work that you do not have locally.&quot;</p>
  <p>I guess I could perhaps just destroy the GitLab repo, rebuild it and re-push, but a) I'd like to be sure that the <code>git rm</code> I mentioned above will have done what I want, and b) it seems there might be an easier route?</p>
  <p>I've found lots of answers that dance around various permutations of these elements (though nothing specific to GitLab). Frankly, however, they're all just different enough that I'd prefer an answer that's specific to this particular set of constraints.</p>