title: Remove a file from git history using git-filter-repo on a fresh clone
body: <p>I'm following <a href="https://stackoverflow.com/a/59727801/333340">this answer</a> to remove a single file containing credentials from git history. I have git 2.35.1 and filter-repo 22826b5a68b6. The command I need is apparently:</p>
  <pre><code>git-filter-repo --path auth.json --invert-paths
  </code></pre>
  <p>If I try to apply this to my working repo, I get this error:</p>
  <pre><code>Aborting: Refusing to destructively overwrite repo history since
  this does not look like a fresh clone.
  (expected freshly packed repo)
  </code></pre>
  <p>So I check out a fresh copy with <code>git clone</code>, and the command runs successfully:</p>
  <pre><code>Parsed 861 commits
  New history written in 0.69 seconds; now repacking/cleaning...
  Repacking your repo and cleaning out old unneeded objects
  HEAD is now at 7212384 Update app.css
  Enumerating objects: 8203, done.
  Counting objects: 100% (8203/8203), done.
  Delta compression using up to 24 threads
  Compressing objects: 100% (2310/2310), done.
  Writing objects: 100% (8203/8203), done.
  Total 8203 (delta 5630), reused 8196 (delta 5623), pack-reused 0
  Completely finished after 2.85 seconds.
  </code></pre>
  <p>And I can see that the file has been removed. But when I go to push:</p>
  <pre><code>git push --force
  fatal: No configured push destination.
  </code></pre>
  <p>for some reason it's lost the remote it cloned from, so I add it back in manually:</p>
  <pre><code>git remote add origin git@git.example.com:abc/xyz.git
  </code></pre>
  <p>This fails with:</p>
  <pre><code>fatal: The current branch master has no upstream branch.
  </code></pre>
  <p>so I add that with</p>
  <pre><code>git push --set-upstream origin master
  </code></pre>
  <p>but this fails too:</p>
  <pre><code>To git.example.com:abc/xyz.git
   ! [rejected]        master -&gt; master (fetch first)
  error: failed to push some refs to 'git.example.com:abc/xyz.git'
  hint: Updates were rejected because the remote contains work that you do
  hint: not have locally. This is usually caused by another repository pushing
  hint: to the same ref. You may want to first integrate the remote changes
  hint: (e.g., 'git pull ...') before pushing again.
  hint: See the 'Note about fast-forwards' in 'git push --help' for details.
  </code></pre>
  <p>but I know that nothing has been pushed to this repo since checking it out. Repeating the process has the same result. If I do a <code>git pull</code> to update it, it then fails again with the <code>this does not look like a fresh clone</code> error, right back where I started.</p>
  <p>I went round and around this a few times, eventually getting past all the errors, only to find that it has all made no difference to my repo – the file is still there.</p>
  <p>So my question is what are the exact steps I should do to make this filtering process work on a freshly cloned repo?</p>