0

Lately when I try to push a new branch to my git repository, the push operation never ends (+1-2 hours). Specifically, it gets stuck in the "updating 'refs/heads/branch_name'" step.

git -c diff.mnemonicprefix=false -c core.quotepath=false --no-optional-locks push -v --set-upstream origin hotfix/2.1.16.2:hotfix/2.1.16.2

Pushing to http://git.myserver.com/myrepo.git
Getting pack list
Fetching remote heads...
  refs/
  refs/tags/
  refs/remotes/
  refs/heads/
  refs/heads/release/
  refs/heads/support/
  refs/heads/hotfix/
  refs/heads/enhancement/
  refs/heads/change/
  refs/heads/features/
  refs/heads/feature/
  refs/heads/bug/
  refs/heads/Feature/
updating 'refs/heads/hotfix/2.1.16.2'
  from 0000000000000000000000000000000000000000
  to   e3a46b991229a1062e291a8e0cf17470fbceb2ca

This happens only with branches that don't exist in the repository. Pushing to an existing branch works fine.

I've tried to run the following commands. Nothing changed.

git remote prune origin

git gc --prune=now

I've also cloned my repository again and tried to push a new branch from the clean copy. I still get the same problem.

UPDATE

Enabling logs with the following commands

set GIT_TRACE=1
set GIT_CURL_VERBOSE=1

Observing the logs, I can see that at the beggining it works fine, resolving lots of requests in just a few seconds. But at some point the requests slow down, to the point where it only resolves a single request each 5 seconds. This is when the "stuck state" happens.

15:25:49.583692 http.c:724              == Info: Connection #9 to host git.myserver.com left intact
15:25:54.757923 http.c:724              == Info: Connection 9 seems to be dead
15:25:54.757923 http.c:724              == Info: Closing connection 9
15:25:54.757923 http.c:724              == Info: NTLM-proxy picked AND auth done set, clear picked
15:25:54.757923 http.c:724              == Info: Hostname git.myserver.com was found in DNS cache
15:25:54.757923 http.c:724              == Info:   Trying <myIP>:80...
15:25:54.808861 http.c:724              == Info: Connected to git.myserver.com (<myIP>) port 80 (#10)
15:25:54.808861 http.c:724              == Info: Server auth using Basic with user 'username'
15:25:54.808861 http.c:671              => Send header, 0000000286 bytes (0x0000011e)
15:25:54.808861 http.c:683              => Send header: PROPFIND /my.git/objects/21/ HTTP/1.1
15:25:54.808861 http.c:683              => Send header: Host: git.myserver.com
15:25:54.808861 http.c:683              => Send header: Authorization: Basic <redacted>
15:25:54.808861 http.c:683              => Send header: User-Agent: git/2.40.0.windows.1
15:25:54.808861 http.c:683              => Send header: Accept: */*
15:25:54.808861 http.c:683              => Send header: Accept-Encoding: deflate, gzip, br, zstd
15:25:54.808861 http.c:683              => Send header: Depth: 1
15:25:54.808861 http.c:683              => Send header: Content-Type: text/xml
15:25:54.808861 http.c:683              => Send header: Content-Length: 94
15:25:54.808861 http.c:683              => Send header: Expect: 100-continue
15:25:54.808861 http.c:683              => Send header:
15:25:54.851484 http.c:671              <= Recv header, 0000000023 bytes (0x00000017)
15:25:54.852534 http.c:683              <= Recv header: HTTP/1.1 100 Continue
15:25:54.852534 http.c:724              == Info: We are completely uploaded and fine
15:25:54.885968 http.c:671              <= Recv header, 0000000027 bytes (0x0000001b)
15:25:54.885968 http.c:683              <= Recv header: HTTP/1.1 207 Multi-Status
15:25:54.885968 http.c:671              <= Recv header, 0000000037 bytes (0x00000025)
15:25:54.885968 http.c:683              <= Recv header: Date: Sat, 27 Sep 2025 13:25:48 GMT
15:25:54.885968 http.c:671              <= Recv header, 0000000016 bytes (0x00000010)
15:25:54.885968 http.c:683              <= Recv header: Server: Apache
15:25:54.885968 http.c:671              <= Recv header, 0000000041 bytes (0x00000029)
15:25:54.885968 http.c:683              <= Recv header: Content-Type: text/xml; charset="utf-8"
15:25:54.885968 http.c:671              <= Recv header, 0000000028 bytes (0x0000001c)
15:25:54.885968 http.c:683              <= Recv header: Transfer-Encoding: chunked
15:25:54.885968 http.c:671              <= Recv header, 0000000002 bytes (0x00000002)
15:25:54.885968 http.c:683              <= Recv header:
15:25:55.536603 http.c:724              == Info: Connection #10 to host git.myserver.com left intact
15:25:59.981371 http.c:724              == Info: Found bundle for host: 0x1c6c8aac670 [serially]
15:25:59.982323 http.c:724              == Info: Can not multiplex, even if we wanted to
15:25:59.982323 http.c:724              == Info: Re-using existing connection #10 with host git.myserver.com
15:25:59.982323 http.c:724              == Info: Server auth using Basic with user 'username'
15:25:59.982323 http.c:671              => Send header, 0000000286 bytes (0x0000011e)
15:25:59.982323 http.c:683              => Send header: PROPFIND /my.git/objects/6d/ HTTP/1.1
[..]
15:26:00.616195 http.c:724              == Info: Connection #10 to host git.myserver.com left intact
15:26:05.829810 http.c:724              == Info: Connection 10 seems to be dead
15:26:05.829810 http.c:724              == Info: Closing connection 10
15:26:05.830909 http.c:724              == Info: NTLM-proxy picked AND auth done set, clear picked
15:26:05.830909 http.c:724              == Info: Hostname git.myserver.com was found in DNS cache
15:26:05.830909 http.c:724              == Info:   Trying <myIP>:80...
15:26:05.864257 http.c:724              == Info: Connected to git.myserver.com (<myIP>) port 80 (#11)
15:26:05.865243 http.c:724              == Info: Server auth using Basic with user 'username'
15:26:05.865243 http.c:671              => Send header, 0000000286 bytes (0x0000011e)
15:26:05.865243 http.c:683              => Send header: PROPFIND /my.git/objects/f4/ HTTP/1.1
[..]

It starts doing PROPFIND request, the wait time between each one being around 5 seconds, so it never ends.

I am using a plain Git server. Is this something related to any Git config? Could it be related to the server's network configuration?

6
  • Where is your repository hosted? Commented Sep 26 at 8:06
  • It's a private server which hosts several repositories. The issue only happens in this repository. Commented Sep 26 at 8:32
  • If you are on Mac and on Git 2.51.0 it might be something about case insensitivity since there is both refs/heads/feature/ and refs/heads/Feature/. Commented Sep 26 at 9:06
  • the "from 0000000000000000000000000000000000000000" seems suspicious. my guess would be a corrupted blob. My guess is that you should try a fresh clone of the repo to see if the issue persists. If it does, you could check your https configuration, maybe the webserver does something unexpected. Commented Sep 26 at 11:44
  • All-zeros is normal for a ref that is being created. What does the server do while it's "stuck"? Is it a plain Git server, or is it using GitLab, or is it using Forgejo/Gitea? What do you see in htop or ps axf? Commented Sep 26 at 12:30

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.