2

The following git commands take way too long to execute on my Windows PC:

  • git config --list
  • git branch
  • git push
  • git pull

Sometimes, Git throws the following error:

PS D:\SB\Code\Sharepoint_Integration> git branch
      0 [main] less (5036) C:\Users\gautamj\AppData\Local\Programs\Git\usr\bin\less.exe: *** fatal error - add_item ("\??\C:\Users\gautamj\AppData\Local\Programs\Git", "/", ...) failed, errno 1
Stack trace:
Frame         Function      Args
0007FFFFCD30  00021006116E (000210290E7A, 000210272B51, 000000008000, 0007FFFF8B30) msys-2.0.dll+0x2116E
End of stack trace
Loaded modules:
000100400000 less.exe
0005D1C20000 msys-pcre2-8-0.dll
7FFB3C1D0000 advapi32.dll
7FFB3D6A0000 msvcrt.dll
7FFB3C280000 sechost.dll
7FFB3C050000 RPCRT4.dll
7FFB3A390000 CRYPTBASE.DLL
7FFB3ACD0000 bcryptPrimitives.dll

However, commands like git add and git commit executes almost instantly, like it's supposed to. From the error, it looks like less.exe is the main reason. From my research, this occurs in PCs registered to a domain (and the problem being the domain controller), which mine happens to be. This issue only happens when I am connected to wifi. But, how do I resolve it?

EDIT: I do not face the problem when running git commands with the --no-pager flag. However, if I use the less.exe directly (say echo test | /path/to/less.exe) the problem persists.

5
  • First try to exclude less: do commands like git --no-pager config --list and git --no-pager branch run quick enough? Second, exclude git: does command echo test | less.exe run fast? Commented Jul 14, 2023 at 8:39
  • 1
    Does this answer your question? "git branch" command is slow from Git Bash on Windows Commented Jul 14, 2023 at 8:46
  • 1
    @phd thanks for those commands, i've edited the question, the test proves that the issue is indeed with less.exe Commented Jul 14, 2023 at 17:00
  • @j6t the issue is similar, but there is no clear solution, especially because of the security implications Commented Jul 14, 2023 at 17:01
  • One solution is to ensure that the domain controller is reachable. Then there are no security implications. Commented Jul 14, 2023 at 17:20

2 Answers 2

0

This was a known bug in Git for Windows v2.41.0.windows.1

Simply upgrading to Git for Windows v2.42.0.windows.2 solved the problem.

Some Git commands (those producing paged output, for example) experienced a significant slow-down under certain circumstances, when running on a machine joined to a domain controller, which has been fixed.

Sign up to request clarification or add additional context in comments.

Comments

0

For some reason I still face this issue in Git for Windows 2.49.0.

Solution: Remove the less.exe that comes preinstalled with git and install less-Windows

Comments

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.