title: How to push a shallow clone to a new repo?
body: <p>I wish to get rid of a lot of my repo's old history, so I did a shallow clone to get the last 50 commits only:</p>
  
  <pre><code>git clone --depth=50 https://my.repo
  </code></pre>
  
  <p>That worked OK, but when I create a new Gitlab repo and try to push it I get an error:</p>
  
  <pre><code>git remote remove origin
  git remote add origin https://my.repo
  git push -u origin --all
  [...]
   ! [remote rejected] master -&gt; master (shallow update not allowed)
  </code></pre>
  
  <p>But I only want these 50 commits to be in my new repo's history.  How can I tell git that it should just treat these 50 commits as the only commits in the new repo?</p>