我有一个带有几个子模块的git存储库,并且在我的Windows 10 build 15063上获得了可怕的性能,而在我的Linux Mint 18 Sarah上,速度一切都很快。
在Windows和Linux上都使用Smartgit
客户端,我可以在test
分支上执行签出,但需要3分钟才能在Windows计算机上完成此过程:
Check Out Branch
D:\SublimeText\Data\Packages> git.exe checkout test
Switched to branch 'test'
D:\SublimeText\Data\Packages\Default Syntax> git.exe fetch --progress --prune --recurse-submodules=no origin
D:\SublimeText\Data\Packages\Force Rewrite Sublime Settings> git.exe fetch --progress --prune --recurse-submodules=no origin
D:\SublimeText\Data\Packages\Side-by-Side Settings> git.exe fetch --progress --prune --recurse-submodules=no origin
D:\SublimeText\Data\Packages\Overwrite Commit Completion> git.exe fetch --progress --prune --recurse-submodules=no origin
D:\SublimeText\Data\Packages\Sublime Text Studio> git.exe fetch --progress --prune --recurse-submodules=no origin
D:\SublimeText\Data\Packages\MarkdownLight> git.exe fetch --progress --prune --recurse-submodules=no origin
D:\SublimeText\Data\Packages\Fixed Selections Clear> git.exe fetch --progress --prune --recurse-submodules=no origin
D:\SublimeText\Data\Packages\SublimeCodeIntel> git.exe fetch --progress --prune --recurse-submodules=no origin
D:\SublimeText\Data\Packages\Open Auto Completion> git.exe fetch --progress --prune --recurse-submodules=no origin
D:\SublimeText\Data\Packages\amxmodx> git.exe fetch --progress --prune --recurse-submodules=no origin
D:\SublimeText\Data\Packages\Shell Script> git.exe fetch --progress --prune --recurse-submodules=no origin
D:\SublimeText\Data\Packages\Notepad++ Color Scheme> git.exe fetch --progress --prune --recurse-submodules=no origin
D:\SublimeText\Data\Packages\LaTeXTools> git.exe fetch --progress --prune --recurse-submodules=no origin
D:\SublimeText\Data\Packages\.versioning> git.exe fetch --progress --prune --recurse-submodules=no origin
D:\SublimeText\Data\Packages\Toolbar> git.exe fetch --progress --prune --recurse-submodules=no origin
D:\SublimeText\Data\Packages\BBCode> git.exe fetch --progress --prune --recurse-submodules=no origin
D:\SublimeText\Data\Packages\Select All Spelling Errors> git.exe fetch --progress --prune --recurse-submodules=no origin
D:\SublimeText\Data\Packages\Markdown to BB Code Converter> git.exe fetch --progress --prune --recurse-submodules=no origin
D:\SublimeText\Data\Packages\All Autocomplete> git.exe fetch --progress --prune --recurse-submodules=no origin
D:\SublimeText\Data\Packages\Package Control> git.exe fetch --progress --prune --recurse-submodules=no origin
D:\SublimeText\Data\Packages\AutoFileName> git.exe fetch --progress --prune --recurse-submodules=no origin
D:\SublimeText\Data\Packages\SQL Keyword Uppercase> git.exe fetch --progress --prune --recurse-submodules=no origin
D:\SublimeText\Data\Packages\Fix Project Switch Restart Bug> git.exe fetch --progress --prune --recurse-submodules=no origin
D:\SublimeText\Data\Packages\Indent and braces> git.exe fetch --progress --prune --recurse-submodules=no origin
D:\SublimeText\Data\Packages\Override Unpacked Packages> git.exe fetch --progress --prune --recurse-submodules=no origin
D:\SublimeText\Data\Packages\GotoLastEditEnhanced> git.exe fetch --progress --prune --recurse-submodules=no origin
D:\SublimeText\Data\Packages\PowerCursors> git.exe fetch --progress --prune --recurse-submodules=no origin
D:\SublimeText\Data\Packages\FuzzyFilePath> git.exe fetch --progress --prune --recurse-submodules=no origin
D:\SublimeText\Data\Packages\Clear Cursors Carets> git.exe fetch --progress --prune --recurse-submodules=no origin
D:\SublimeText\Data\Packages\ANSIescape> git.exe fetch --progress --prune --recurse-submodules=no origin
D:\SublimeText\Data\Packages\Preferences Editor> git.exe fetch --progress --prune --recurse-submodules=no origin
D:\SublimeText\Data\Packages\BufferScroll> git.exe fetch --progress --prune --recurse-submodules=no origin
D:\SublimeText\Data\Packages\PackageDev> git.exe fetch --progress --prune --recurse-submodules=no origin
D:\SublimeText\Data\Packages\Clipboard Scope Copy> git.exe fetch --progress --prune --recurse-submodules=no origin
D:\SublimeText\Data\Packages\SideBarEnhancements> git.exe fetch --progress --prune --recurse-submodules=no origin
D:\SublimeText\Data\Packages\View Settings Freely> git.exe fetch --progress --prune --recurse-submodules=no origin
D:\SublimeText\Data\Packages\Fix Selection After Indent> git.exe fetch --progress --prune --recurse-submodules=no origin
D:\SublimeText\Data\Packages\Amxx Pawn> git.exe fetch --progress --prune --recurse-submodules=no origin
D:\SublimeText\Data\Packages\SublimeREPL> git.exe fetch --progress --prune --recurse-submodules=no origin
D:\SublimeText\Data\Packages\SyncedSideBar> git.exe fetch --progress --prune --recurse-submodules=no origin
D:\SublimeText\Data\Packages\Active View Jump Back> git.exe fetch --progress --prune --recurse-submodules=no origin
否则在Linux机器上,使用相同的存储库,我可以在test
分支上以5秒钟的速度结账:
Check Out Branch
~/.config/sublime-text-3/Packages> git checkout test_linux
Switched to branch 'test'
是否可以像在Linux上的git checkout
那样快速地在Windows上进行git checkout?
我发现了另一个问题,但是我不明白它是否适用于此:
在@derHugo评论之后,我发现在Windows上从命令行运行git并输入git checkout test
与在linux上一样快。
现在我必须改变这个问题,并问为什么用于Windows的Smartgit客户端正在做这么慢的事情,而Linux的那个客户端却没有。
如何在Windows Smartgit客户端上禁用此慢速检出以及后果是什么?
答案 0 :(得分:3)
SmartGit似乎执行了一系列git.exe命令,每个命令都必须产生一个bash会话(产生/启动一个新的shell很慢)。
请参阅" How are msys, msys2, and msysgit related to each other?"
如果你在git bash会话中做同样的事情,那么所有这些命令(对于每个子模块checkout)都可以重用当前的shell会话:更快,甚至在Windows上。