Paulo Candido
Paulo Candido

Reputation: 185

Git hookerror when pushing tags to GitLab

I am getting an error when trying to push two to GitLab. I have a script that creates and pushes two tags at the same time: v1.1.x and h1.1.x. When I try executing git push --tags I got an error. Follow an extended command:

$ GIT_CURL_VERBOSE=1 GIT_TRACE=1 git push --tags

20:38:25.736696 git.c:418               trace: built-in: git push --tags
20:38:25.738046 run-command.c:643       trace: run_command: unset GIT_PREFIX; ssh [email protected] 'git-receive-pack '\''xxxxxx/xxxxxx/xxxxxx.git'\'''
20:38:28.461014 run-command.c:643       trace: run_command: git pack-objects --all-progress-implied --revs --stdout --thin --delta-base-offset --progress
20:38:28.464277 git.c:418               trace: built-in: git pack-objects --all-progress-implied --revs --stdout --thin --delta-base-offset --progress
Enumerating objects: 2, done.
Counting objects: 100% (2/2), done.
Delta compression using up to 12 threads
Compressing objects: 100% (2/2), done.
Writing objects: 100% (2/2), 298 bytes | 298.00 KiB/s, done.
Total 2 (delta 0), reused 0 (delta 0)
error executing git hookerror executing git hookfatal: ref updates aborted by hook
fatal: the remote end hung up unexpectedly
fatal: the remote end hung up unexpectedly

If I try to push each tag at a time, it works, so it seems to be just when pushing multiple tags. I had a CI pipeline configured on one of the tags, but I have already removed the CI file and it does not help.

I have no custom git hook set up, by the way, I use the free version of GitLab. I also did not reach my CI quota. These tags are protected, but I am allowed to push them.

Why can't I push my tags to GitLab?

EDIT Actually, sometimes I can't even push the tags separately, I can't find a pattern yet.

Upvotes: 0

Views: 344

Answers (1)

Oliver Hoang
Oliver Hoang

Reputation: 26

I have come across the same issue as you are facing. It may not allow you to push a new commit and new tags at the same time. but you can always split out to 2 separate operations. Try out below commands it worked for me.

git push -u origin <branch>

git push -u origin --tags

Upvotes: 1

Related Questions