我目前在 Mac 上。
\n在 Git 2.35.1 中,当我克隆存储库时,需要 7 秒来枚举未跟踪的文件,而当我这样做时time git status,大约需要 2 秒。\n而且,当我签出到其他分支时,大约需要 15 秒,而当我签出时,大约需要 15 秒。返回我的主仓库git status花了 15 秒(不应该花这么多时间)。
(2.35.1) 中的解决方法是:\n我设置core.untrackedCache=true并GIT_FORCE_UNTRACKED_CACHE=1\n这有助于更新未跟踪的缓存并提高git status大多数 Stack Overflow 答案中提到的性能(大约 4 秒)。\n stack-溢出问题
但现在在 Git 2.36.1 中,这种解决方法似乎不起作用。所有分支大约需要 20 秒。
\n代码中可能的更改:
\n在 Git 2.35.1 中,代码如下dir.c:
if (dir->untracked) {\n static int force_untracked_cache = -1;\n\n if (force_untracked_cache < 0)\n force_untracked_cache =\n git_env_bool("GIT_FORCE_UNTRACKED_CACHE", 0);\n if (force_untracked_cache &&\n dir->untracked …Run Code Online (Sandbox Code Playgroud)