title: how create a new git repo whose first commit is the last commit of the source (no history, not linked to source repo, and only the master branch)
body: <p>How do I create a clone of a git repo that contains only the master branch, and only the most recent commit, AND can be pushed to a new repo at github/bitbucket/etc?</p>
  <p>I've got a large git repo... couple of GB... that grew over a decade... lots of obsolete binary cruft... lots of old branches. That's the current legacy app.</p>
  <p>We're creating a new app and want to create a new repo that contains only the current commit and the master branch.</p>
  <p>I thought maybe I should do some sort of shallow clone like <code>git clone --depth [depth] [remote-url]</code> but</p>
  <p>a) I'm not sure how to also not include any branches except master?</p>
  <p>b) more importantly, the problem with <code>git clone --depth</code> is it creates some kind of 'grafted' commit, which cannot then be pushed to github (the &quot;shallow update not allowed&quot; issue).</p>
  <p>I should mention, in this case, I have the legacy repo on the same computer, in case the &quot;right answer is to simply copy the project folder and trash the .git folder. But I'm hoping as a more general solution that there's git-way to do it.</p>