git-for-windows / git

A fork of Git containing Windows-specific patches.
http://gitforwindows.org/
Other
8.39k stars 2.55k forks source link

`push` and `pull` really slow #4601

Open astrohart opened 1 year ago

astrohart commented 1 year ago

Setup

$ cmd.exe /c ver
Microsoft Windows [Version 10.0.19045.3393]

Editor Option: VIM Custom Editor Path: Default Branch Option: Path Option: Cmd SSH Option: OpenSSH Tortoise Option: false CURL Option: OpenSSL CRLF Option: CRLFAlways Bash Terminal Option: MinTTY Git Pull Behavior Option: Merge Use Credential Manager: Enabled Performance Tweaks FSCache: Enabled Enable Symlinks: Disabled Enable Pseudo Console Support: Disabled Enable FSMonitor: Disabled


 - Any other interesting things about your environment that might be related
   to the issue you're seeing?

No, not that I can think of, offhand.

### Details

 - Which terminal/shell are you running Git from? e.g Bash/CMD/PowerShell/other

** insert your response here **

 - What commands did you run to trigger this issue? If you can provide a
   [Minimal, Complete, and Verifiable example](http://stackoverflow.com/help/mcve)
   this will help us understand the issue.

git push -u origin master


 - What did you expect to occur after running these commands?

A push and relatively fast.

 - What happened instead?
With v2.42.0, all of a sudden, `push`es and `pull`s t seem to take much longer than in the past. Do you know if extra pinging was added?

When I initiate a push of even a single commit containing a single file, the push takes ~15-30 seconds of just hanging before it completes.  This did not strike me to be the case with the version I was using beforehand, which I upgraded recently to 2.42.0, only to have `push` and `pull` start being slow.  I do not remember the exact build of Git for Windows I was using before 2.42.0.  

 - If the problem was occurring with a specific repository, can you provide the
   URL to that repository to help us with testing?

No, not a problem with a specific repo
dscho commented 1 year ago

That's not very much information to go on. Maybe you can spot anything suspicious in the output of git push when running with GIT_TRACE_CURL=1.

luhansen-ms commented 1 year ago

@astrohart What remote host is your repo using?

In Visual Studio, we've seen some reports of slow performance with Git for Windows 2.41.0.3. But nothing yet on 2.42.

I'm trying to correlate and see if this could have been a problem with some Git web hosts that recently popped up.

astrohart commented 1 year ago

Using https://github.comNot sure what else you would be referring to. Perhaps I’d speculate that there is extraneous pinging or multi factor auth going on.  I have no idea if this is the case, just throwing random things out there. BrianOn Sep 20, 2023, at 11:16, Luke Hansen @.***> wrote: @astrohart What remote host is your repo using? In Visual Studio, we've seen some reports of slow performance with Git for Windows 2.41.0.3. But nothing yet on 2.42. I'm trying to correlate and see if this could have been a problem with some Git web hosts that recently popped up.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>

dscho commented 1 year ago

Maybe you can spot anything suspicious in the output of git push when running with GIT_TRACE_CURL=1.

astrohart commented 1 year ago

I am fixing this issue temporarily, by downgrading to Git 2.37.2. I have not experienced the same issue with that version of Git. Is there any way I can put diagnostic info on this thread, from that version of Git? I am on Windows 10. I am not 100% sure what sort of diagnostics would be useful, so I am open to input.

dscho commented 1 year ago

Is there any way I can put diagnostic info on this thread, from that version of Git?

That would be the GIT_TRACE_CURL=1 thing I mentioned earlier, I think.

astrohart commented 1 year ago

Thanks, I will try it the next time I do a Git operation. Thank you.

pedrohgmacedo commented 12 months ago

I was having this problem. Using the trace options, I found that the operation that lasted the longer was the ssh. Using git pull --ipv4 I noticed it was not as slow as before. So what fixed the problem was forcing github.com to use ipv4 in the ssh_config.

Host github.com
    AddressFamily inet
dscho commented 12 months ago

I was having this problem. Using the trace options, I found that the operation that lasted the longer was the ssh. Using git pull --ipv4 I noticed it was not as slow as before. So what fixed the problem was forcing github.com to use ipv4 in the ssh_config.

Host github.com
    AddressFamily inet

That strikes me as a pragmatic work-around and valuable information for users who are in the same situation as you are. Thank you @pedrohgmacedo!

pedrohgmacedo commented 12 months ago

@dscho It would be very useful to have a config option to force ipv4/6, just like the command switch.

astrohart commented 12 months ago

I agree with @pedrohgmacedo

dscho commented 12 months ago

It would be very useful to have a config option to force ipv4/6, just like the command switch.

If this was a feature request, you might be better off taking it to the Git mailing list (send plain-text messages, HTML messages are dropped silently), as it has literally nothing Windows-specific about it.

You may also want to word it in a way designed to entice somebody else to implement this, or at least to help you implementing the feature.