{"thread":{"id":"57705","subject":"git push --tags failed silently when attempting to push a large number of tags","startedAt":"2022-04-09T21:33:06Z","lastAt":"2022-04-09T21:33:06Z","messageCount":1,"participants":["Trevor Burnham"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"453373","messageId":"E7B246D2-5B72-4BA1-97DB-5300A9074C42@gmail.com","threadId":"57705","inReplyTo":null,"subject":"git push --tags failed silently when attempting to push a large number of tags","fromName":"Trevor Burnham","fromEmail":"trevorburnham@gmail.com","sentAt":"2022-04-09T21:32:58Z","receivedAt":"2022-04-09T21:33:06Z","isPatch":false,"sender":{"key":"trevorburnham@gmail.com","avatar":null},"body":"# What did you do before the bug happened? (Steps to reproduce your issue)\n\nI ran into this issue when trying to create a mirror of a repo with approximately 129,000 tags. I created a fresh clone of the existing remote (origin), created the new remote (new-remote), then pushed the main branch up to the new remote. (This initially failed with `fatal: pack exceeds maximum allowed size`, so I pushed the branch in chunks of 500 commits.) Here’s where things became strange:\n\n```\n$ git push new-remote --tags\n```\n\nThat command ran without error but emitted no output, even with `--verbose`. The command `git push new-remote --refs/tags/\\*` had the same result, as expected. No tags were pushed. I also tried `git push new-remote --follow-tags`, which failed after several hours due to a connection timeout.\n\nI tried pushing some tags individually, and that worked fine. So did pushing up smaller subsets of tags:\n\n```\n# push all tags that start with the letter a\n$ git push new-remote +refs/tags/a\\*\n# push all tags that start with the letter b\n$ git push new-remote +refs/tags/b\\*\n...\n```\n\nThose worked fine, until I tried pushing up a subset with approximately 62,000 tags, which failed:\n\n```\n# push all 62,000 tags that start with the letter c\n$ git push new-remote +refs/tags/c\\*\nPushing to github.com:my-org/new-remote.git\nremote: fatal error in commit_refs\nTo github.com:my-org/new-remote.git\n ! [remote rejected]         c1 -> c1 (failure)\n ! [remote rejected]         c2 -> c2 (failure)\n```\n\nAs I understand it, the error message `fatal error in commit_refs` is generated by GitHub. I was able to push those tags up by splitting the subset further, so it seems that GitHub is rejecting pushes that contain too many tags/too much data at once. I was eventually able to push all of my tags up in this way.\n\nSo to sum up:\n\n1. Trying to push 62,000 tags at once failed with the error `remote: fatal error in commit_refs`.\n2. Trying to push 129,000 tags at once had no effect but did not trigger any error (or any output of any kind).\n\n# What did you expect to happen? (Expected behavior)\n\nSince `git push new-remote --tags` did not succeed in pushing my tags (presumably due to an unexpected response from the remote), it should exit with a non-zero status code and emit an error message.\n\nIt would also be helpful for `git push --verbose` to include more output, to better identify which step failed.\n\n# What happened instead? (Actual behavior)\n\nThe `git push new-remote --tags` command did not push any tags, but returned with status 0 and did not emit any output to stdout or stderr.\n\n# System info from `git bugreport`\n\ngit version:\ngit version 2.35.1\ncpu: arm64\nno commit associated with this build\nsizeof-long: 8\nsizeof-size_t: 8\nshell-path: /bin/sh\nuname: Darwin 21.4.0 Darwin Kernel Version 21.4.0: Fri Mar 18 00:46:32 PDT 2022; root:xnu-8020.101.4~15/RELEASE_ARM64_T6000 arm64\ncompiler info: clang: 13.0.0 (clang-1300.0.29.3)\nlibc info: no libc information available\n$SHELL (typically, interactive shell): /bin/zsh\n\n\n"}]}