0

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.

Gautam J
  • 651
  • 1
  • 6
  • 13
  • 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? – phd Jul 14 '23 at 08:39
  • 1
    Does this answer your question? ["git branch" command is slow from Git Bash on Windows](https://stackoverflow.com/questions/72436188/git-branch-command-is-slow-from-git-bash-on-windows) – j6t Jul 14 '23 at 08:46
  • 1
    @phd thanks for those commands, i've edited the question, the test proves that the issue is indeed with less.exe – Gautam J Jul 14 '23 at 17:00
  • @j6t the issue is similar, but there is no clear solution, especially because of the security implications – Gautam J Jul 14 '23 at 17:01
  • One solution is to ensure that the domain controller is reachable. Then there are no security implications. – j6t Jul 14 '23 at 17:20

0 Answers0