title: How to compact local git repo
body: <p>Can I achieve the result of <code>git clone --depth=1</code> on a local already cloned repo which has all history while the aim is to keep all the ignored files in place?</p>
  
  <p>I have several git projects consuming lots of space and I would like to remove all git history to release some space. Thanks.</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>To be more precise:</p>
  
  <ul>
  <li>I don't want to do any manual work with moving files here and there, deleting repo, recreate, etc</li>
  <li>I have some config files in <code>assume-unchanged</code> state which must be kept</li>
  <li>I have many gitignored files which must be left in place</li>
  </ul>
  
  <p>These reasons can make it clear why I don't want to re-clone and set up all credentials and stuff on 30 repos.</p>
  
  <p>Ideally I'm looking for something I could even run in batch on all project. If there's no such thing, then I'm fine with it of course.</p>