title: Trying to push large number of commits in batches
body: <p>I'm working on a extremely large project that needs to migrate from Team Foundation Services to Git. I performed the local conversion successfully, garnering 2800+ commits that need to be pushed to github. A few of these commits are pretty large and a simple git push gets about 3% of the way in before returning the following error:</p>
  
  <pre><code>fatal: pack exceeds maximum allowed size
  </code></pre>
  
  <p>There seems to be a roughly 2.9gb limit on the size of an upcoming pack. That seemed reasonable, so I've been searching on Stackoverflow to see how I can push these commits up. I swapped to using SSH, but the error still persists but then I came across this line of GIT Bash code in a comment that seems to aim towards what I want (sending up the commits in batches):</p>
  
  <pre><code>max=$(git log --oneline|wc -l); for i in $(seq $max -500 1); do echo $i; g=$(git log --reverse --oneline --skip $i -n1|perl -alne'print $F[0]'); git push gh $g:refs/heads/master; done
  </code></pre>
  
  <p>The challenge is that the comment didn't really mention  how this command works or how to modify it to get it working for my sitaution. I run the code as-is and get the following error:</p>
  
  <pre><code>'gh' does not appear to be a git repository
  </code></pre>
  
  <p>Thinking I know what I'm doing I attempting the follow alternate line of bash code:</p>
  
  <pre><code>max=$(git log --oneline|wc -l); for i in $(seq $max -500 1); do echo $i; g=$(git log --reverse --oneline --skip $i -n1|perl -alne'print $F[0]'); git push origin $g:refs/heads/master; done
  </code></pre>
  
  <p>This returns the following error:</p>
  
  <pre><code>[remote rejected] master (refusing to delete the current branch: refs/heads/master)
  </code></pre>
  
  <p>Clearly I'm doing something wrong but I don't know enough about Git Bash to know what. Can anyone help me figure out what I should have typed in there?</p>
  
  <p>git branch results:</p>
  
  <ul>
  <li>master</li>
  </ul>