git/list[1] front-page[2] threads[3] people[4] search[5] about
 

git push --tags failed silently when attempting to push a large number of tags

From
TBTrevor Burnham <trevorburnham@gmail.com>
Date
Apr 9, 2022, 21:32 UTC
Message-ID
<E7B246D2-5B72-4BA1-97DB-5300A9074C42@gmail.com>
# What did you do before the bug happened? (Steps to reproduce your issue)
I 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:

``` $ git push new-remote --tags ```

That 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.
I tried pushing some tags individually, and that worked fine. So did pushing up smaller subsets of tags:

``` # push all tags that start with the letter a $ git push new-remote +refs/tags/a\* # push all tags that start with the letter b $ git push new-remote +refs/tags/b\* ... ```

Those worked fine, until I tried pushing up a subset with approximately 62,000 tags, which failed:
```
# push all 62,000 tags that start with the letter c
$ git push new-remote +refs/tags/c\*
Pushing to github.com:my-org/new-remote.git
remote: fatal error in commit_refs
To github.com:my-org/new-remote.git
 ! [remote rejected]         c1 -> c1 (failure)
 ! [remote rejected]         c2 -> c2 (failure)
```
As 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.
So to sum up:
1. Trying to push 62,000 tags at once failed with the error `remote: fatal error in commit_refs`.
2. Trying to push 129,000 tags at once had no effect but did not trigger any error (or any output of any kind).
# What did you expect to happen? (Expected behavior)
Since `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.
It would also be helpful for `git push --verbose` to include more output, to better identify which step failed.
# What happened instead? (Actual behavior)
The `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.
# System info from `git bugreport`

git version: git version 2.35.1 cpu: arm64 no commit associated with this build sizeof-long: 8 sizeof-size_t: 8 shell-path: /bin/sh uname: 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 compiler info: clang: 13.0.0 (clang-1300.0.29.3) libc info: no libc information available $SHELL (typically, interactive shell): /bin/zsh

Message 1 of 1 in “git push --tags failed silently when attempting to push a large number of tags”
  1. Trevor BurnhamApr 9, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.