0

I was able to migrate a Perforce depot into Git using git-p4. The depot has a huge history, and turned to be +7GB on Git:

MyProj.git\objects\pack

I am trying to push into Team Services, but there seem to be a Push Size Limit:

C:\SomeFolder\MyProj>git push -u origin --all
Counting objects: 41905, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (10604/10604), done.
Writing objects: 100% (41905/41905), 6.83 GiB | 8.34 MiB/s, done.
Total 41905 (delta 30933), reused 41902 (delta 30930)
error: remote unpack failed: error TF402462: This push was rejected because its size is greater than the 5120 MB limit for pushes in this repository. Learn more at https://aka.ms/gitlimit
To https://MyRepoURL/MyProj
 ! [remote rejected]   master -> master (TF402462: This push was rejected because its size is greater than the 5120 MB limit for pushes in this repository. Learn more at https://aka.ms/gitlimit)
error: failed to push some refs to 'https://MyRepo/MyProj'

If I remove files to decrease the size, the size actually gets bigger (Deleted files get tracked on delete).

What are my possible solutions here?

milbrandt
  • 1,438
  • 2
  • 15
  • 20
Sandra K
  • 1,209
  • 1
  • 10
  • 21
  • [Remove large files from history](https://stackoverflow.com/questions/2100907/how-to-remove-delete-a-large-file-from-commit-history-in-git-repository). – phd May 04 '18 at 17:02
  • @phd thanks, that was the fix. I have superProj that I want to merge into it this 7GB local repo, but I do not want the whole history merged. say this repo has 100 commits, can I push only the last (most recent) 10 commits (to then merge just these last 10 commits with superProject)? – Sandra K May 04 '18 at 19:45
  • @phd follow-up https://stackoverflow.com/questions/50182309/how-to-push-merge-specific-commit-history, I believe you can help, and thanks – Sandra K May 04 '18 at 20:14

1 Answers1

1

As already noted in the VSTS documentation you linked, if the repo is larger than 5GB you have to use the "Import repository" functionality.

Go in your VSTS account, create an empty repo (no Readme.md or anything else), fo to Files tab and on the bottom you'll find the Import repo button.

If your repo is really very large, you might have to set up your own TFS in Azure, push/import your repo there and then go in a second step to VSTS. But for 7GB this will not be necessary. But this is more for the case when a whole production TFS is migrated to VSTS.

milbrandt
  • 1,438
  • 2
  • 15
  • 20
  • "import repo" needs the remote URL, but my Repo is only local – Sandra K May 04 '18 at 19:43
  • Even a local git repo can be accessed. You have an IP address (maybe dynamically from your ISP), you can open ports /set port forwarding to access the repo. Or you set up an machine in Azure, copy your repo there and then do an Import from there. – milbrandt May 04 '18 at 19:59