Push fails when pushed with mirror
option and repo contains 1000s of refs in 'refs/replace'
#21651
-
My team and I are about to move all our repos to Github but I’m having trouble pushing our main repo. As part of the migration we shrunk our repo size by rewriting the git history to remove large files that we no longer need. The tool we used, git-filter-repo, created a 1000s of replace refs under Any help would be appreciated, and it would be great if I can tell what the internal server error is |
Beta Was this translation helpful? Give feedback.
Replies: 8 comments
-
👋 Welcome! 500 is a hard one to troubleshoot! Have you resolved this yet? |
Beta Was this translation helpful? Give feedback.
-
Sort of.
|
Beta Was this translation helpful? Give feedback.
-
Hi @thejewdude I am facing same error while migrating code from gerrit to github, can you please elaborate what have you done. TIA |
Beta Was this translation helpful? Give feedback.
-
Basically the command line I posted above pushes the refs in smaller chunks. I’m using the Linux program xargs to automatically chunk pushing the refs (I think it was about 500 at a time) In my case I had > 10,000 replace refs, that’s why my command line mentions refs/replace. Let me know if something still isn’t clear! |
Beta Was this translation helpful? Give feedback.
-
Thanks, it worked for some repos but unfortunately for some its failing |
Beta Was this translation helpful? Give feedback.
-
What does unsetting the mirror do? |
Beta Was this translation helpful? Give feedback.
-
I am unsetting the mirror because i faced this |
Beta Was this translation helpful? Give feedback.
-
FWIW, I added -P 3 to the command from @thejewdude to run some of the pushes in parallel, got my repo to push in about 30 minutes vs 2 hours before. And thanks so much @thejewdude, your script saved me hours of frustration :)
|
Beta Was this translation helpful? Give feedback.
Sort of.
I reached out to support by email and one of your colleagues indicated that its a known limitation that GitHub will timeout when trying to push too many refs at once. Their suggestion was to push the refs in smaller chunks. I accomplished this with a wee bit of commandline hackery