title: How to squash a Git repository to a single commit and destroy everything else?
body: <p>I would like to squash an entire Git repository down to a single commit, and actually remove all other commits.</p>
  
  <p>I have found several suggestions, including:</p>
  
  <pre><code>$ git reset --soft &lt;root-commit&gt;
  </code></pre>
  
  <p>This works with respect to the squashing, but it's still possible to checkout the previous commits if you know their id. How can I get rid off them as well?</p>
  
  <p>Maybe the simplest solution would be to delete the <code>.git</code> directory, and run <code>git init</code> again, wouldn't it? If I re-add the origin, and then use <code>git push --force</code>, I could even keep the same GitHub repository, right?</p>
  
  <p>PS: In <a href="https://stackoverflow.com/questions/43863765/fix-license-in-old-git-commits">this question</a> I have clarified what I actually want to achieve.</p>