Trying to replicate my GitHub repository to AWS CodeCommit.
After some troubles the AWS IAM role and machine was successfully configured to fetch from github and push to AWS CodeCommit:
origin https://********:[email protected]/org/infra.git (fetch)
origin https://********@git-codecommit.ca-central-1.amazonaws.com/v1/repos/infra (push)
while this works well for smaller repositories the main app repository refused to push:
$ git push --mirror
UnrecognizedFormatException: Too many reference update commands
Enumerating objects: 352143, done.
Counting objects: 100% (352143/352143), done.
Delta compression using up to 2 threads
Compressing objects: 100% (60932/60932), done.
send-pack: unexpected disconnect while reading sideband packet
fatal: the remote end hung up unexpectedly
Tried many git config options but no luck.
Googling the error got me to the page Troubleshooting Git clients and AWS CodeCommit that suggests:
We don't use tags and
git push --allworked well. Though thegit push --mirrorstill didn't work.The Quotas in AWS CodeCommit says:
...well, there is more than 5,000 closed pull requests in the repository and that's where the big number of ref objects come from:
Finally the solution was to push refs in multiple pushes:
...after pushing these the
git push --mirrorfinally worked.