Git submodule update slow on Windows

杀马特。学长 韩版系。学妹 提交于 2021-02-08 04:59:30

问题


Git submodule seems to be extremely slow on Windows.

To test the performance I created 3 bare repos and committed 3 independent messages to them (no files stored). I then added each of these bare repos as submodules in a new git repo and performed a submodule update and it took over 5 seconds.

This seems excessive and very noticeable when using 20+ submodules. What could be causing it to take so long?

Example files: https://drive.google.com/file/d/1n6fAm16tXtt_1YvXbPHhn150iuw-VGOk/view

Run 'git submodule update' inside 'Submodule test'. All submodule URLs in the test are relative.

Running Git version 2.22.0.windows.1 and version 2.23.0.windows.1

Edit:
Tested using regular command line, git bash (as shown), PowerShell and TortoiseGit.

Tested with simplified PATH as suggested by VonC.


回答1:


Try the same:

  • with Git 2.23
  • in a regular CMD
  • with a simplified PATH set in that CMD

See if the issue persists then.

With Git 2.22 (and improved in 2.23), you can measure the performance of a Git command with:

cmd /V /C "set GIT_TRACE2_PERF=C:/Users/me/log.perf&& git submodule update"
or in bash session: 
GIT_TRACE2_PERF=C:/Users/me/log.perf git submodule update 


来源:https://stackoverflow.com/questions/57795214/git-submodule-update-slow-on-windows

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!