IT박스

Msysgit bash는 Windows 7에서 끔찍하게 느립니다.

itboxs 2020. 9. 22. 07:59
반응형

Msysgit bash는 Windows 7에서 끔찍하게 느립니다.


나는 git을 좋아하고 집에서 거의 지속적으로 OS X에서 사용합니다. 직장에서 우리는 Windows에서 svn을 사용하지만 도구가 완전히 성숙하자마자 git로 마이그레이션하려고합니다 ( TortoiseGit 뿐만 아니라 VisualSVN에서 제공하는 정말 멋진 Visual Studio 통합과 유사한 것 ). 하지만 나는 빗나 갔다 ...

나는 최근에 설치 msysgit을 내 윈도우 7 컴퓨터에, 그리고 배쉬의 포함 된 버전을 사용하는 경우, 그것은이다 끔찍하게 느린. 그리고 단지 git 작업이 아닙니다. clear5 초 정도 걸립니다 . AAAAH!

비슷한 문제를 경험 한 사람이 있습니까?


편집 : msysgit이 UAC 에서 잘 작동하지 않는 것으로 보이며 XP에서 개발하거나 UAC가 비활성화 된 상태에서 Vista 또는 7을 실행하여 발생하는 작은 디자인 감독 일 수 있습니다. Git Bash를 사용하여 시작 하면 OS X에서 보는 번개 속도가 나타납니다 (또는 네트워크 연결없이 Git Bash를 시작한 후 7에서 @Gauthier 답변 참조).Run as administrator

편집 2 : AH HA! 내 대답을 참조하십시오.


몇 가지 구성 옵션을 설정하는 세 가지 명령을 실행하여 Windows에서 Git 속도를 크게 높일 수 있습니다.

git config --global core.preloadindex true
git config --global core.fscache true
git config --global gc.auto 256

노트:

  • core.preloadindex 지연 시간을 숨기기 위해 파일 시스템 작업을 병렬로 수행합니다 (업데이트 : git 2.1에서 기본적으로 활성화 됨).

  • core.fscache 관리자 권한으로 Git을 실행할 필요가 없도록 UAC 문제를 수정합니다 (업데이트 : Windows 2.8 용 Git에서 기본적으로 활성화 됨).

  • gc.auto .git /의 파일 수를 최소화합니다.


Vista 또는 7의 속도 저하에 대한 솔루션은 Git Bash를 사용하여 실행하는 것으로 보입니다 Run as administrator(또는 Git Bash 바로 가기에 대한 UAC 비활성화 ... 또는 UAC 완전히 비활성화 ). 차이는 밤낮이며 7에서 git을 사용하는 것은 다시 굉장합니다.

이것은 알려진 문제관련된 것으로 보이며 내가 추측 했듯이 msysgit의 개발 환경XP 가 부분적으로 책임이 있습니다.


나에게 문제는 쉘 프롬프트에서 __git_ps1을 사용하는 것이 었습니다. msysgit의 느린 디스크 액세스로 인한 것 같습니다.

해결책은 / etc / profile의 PS1 = ... 줄에서 $ (__ git_ps1)을 제거하는 것이 었습니다.

이 솔루션이 적용되는지 빠른 테스트 : git 셸에서 export PS1 = '$'를 입력하고 작업 속도를 확인합니다.


새 컴퓨터에서 여기에있는 모든 팁 (다른 답변의 팁 포함)을 시도했지만 작동하지 않았으며 Git은 여전히 ​​지옥처럼 느립니다.

그런 다음 바이러스 검색 소프트웨어 (사전 설치된)를 살펴 보았습니다. McAfee Security Center의 실시간 검색을 비활성화했습니다 . "git svn rebase"에 필요한 시간이 30 초에서 5 초 (!)로 감소했습니다.

이것이 Windows에서 느린 Git에 여전히 문제가있는 다른 사람들에게 도움이되기를 바랍니다.


슬프게도 '관리자 권한으로 실행'이 작동하지 않았지만 Kevin L이 발견했듯이 네트워크 어댑터 연결을 끊고 git bash를 시작한 다음 다시 연결하면 정상적으로 작동했습니다. 그래서 나는 이것을 배치 스크립트로 포장하고 관리자로 실행되도록 플래그가 지정된 시작 메뉴에 바로 가기를 넣었습니다.

netsh interface set interface "Local Area Connection" DISABLED
cd "%USERPROFILE%\Documents\Visual Studio 2010\Projects"
start cmd /c ""C:\Program Files\Git\bin\sh.exe" --login -i"
netsh interface set interface "Local Area Connection" ENABLED

네트워크가 일시적으로 끊어지는 것을 기억하는 한 치료를 수행합니다.

(Win 7 Professional SP1, Git 버전 1.7.8-preview20111206)


제 동료는 Outlook이 실행될 때마다이 동작을했습니다. 전망을 죽이고 다시 테스트하려고합니다.

다음을 테스트 해 볼 수도 있습니다.

  • 네트워크에 연결하지 않고
  • 바이러스 백신을 실행하지 않고
  • 다른 프로그램이 실행되지 않습니다.

특정 사용자 계정에서 실행할 때를 호출 할 때 별도의 git.exe 인스턴스가 차단 WaitForSingleObject()되므로 한 번에 하나의 git.exe 작업 만 효과적으로 실행할 수 있습니다. 사용자 계정을 변경하면이 문제가 해결되었습니다.

여기에 세부 정보 : https://stackoverflow.com/a/13054022


MacAffee가 있고 실시간 검색에서 .git 디렉토리와 모든 하위 디렉토리를 제외하도록 지시하면 성능 문제가 해결되었습니다.


As found in this issue, running with UAC virtualization turned off (it's not needed to disable UAC entirely) makes a big difference.

This post explains how to turn it off (see the bottom of the post, just one registry setting).

On one (large) SVN repo I'm connecting to, making just the above change dropped the time needed for "git svn rebase" from 15s to 5s, a factor 3 improvement.


An alternative to messing with the Windows 7 UAC may be to install mysysgit outside of your Program Files folder. For example instead of "C:\Program Files (x86)\Git", try installing in "C:\git"

I tried fiddling with 'Run as admin' and UAC controls to no avail, but gave up and started over a fresh install. I was getting about 15KiB/s max before, but is now over 60kiB/s.


If turning off UAC doesn't improve performance, try turning off the luafv driver. This worked for me after trying almost everything on this page and the couple of similar questions. Git has gone from unusably slow to pretty decent.

Open 'regedit' and find the registry key

HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/services/luafv

Change the value of Start from 2 to 4.

I found the details on how to disable luafv here. Note that I personally have no idea what luafv is or does. That page gives various warnings about bad things that might happen if you turn it off, which you should probably take seriously.

EDIT: The comment below pointed out I got this the wrong way round (the link has it the right way round). It is fixed now. Sorry to the people whose registries I trashed :)


I've just been troubleshooting this for a while and had a hard time pinpointing the source of the problem. In the end I found two things that had a dramatic impact:

  • Turning off the Windows Search service. This had a dramatic effect on performance.
  • Closing Git Extensions. Having the Git Extensions Browse window open in the background caused Cygwin git command execution times to increase by a seemingly random factor of up to around 10.

The issue here might be the bash-completion if that's enabled, which is quite a bit slower on Windows than Linux.

Try setting the PS1-variable to something simple like "$ ", and see if this speeds things up. If it does, be aware that there's been some optimizations to the bash-completion in recent-ish git-versions. Perhaps you need to upgrade.


This worked for me. Don't expect it will be a one size fits all solution.

Check the $HOME environment variable in bash and windows. If it points to a user account, check the user's windows profile/permissions. Change either the user account or the $HOME accordingly.


I've encountered the same problem running git for Windows (msysgit) on Windows 7 x64 as a limited user account for quite some time. From what I've read here and other places, the common theme seems to be the lack of administrative privileges and/or UAC. Since UAC is off on my system, the explanation that it is trying to write/delete something in the program files directory makes the most sense to me.

In any case, I've resolved my problem by installing the portable version of git 1.8 with zipinstaller. Note that I had to unpack the .7z distribution file and repack it as a zip in order for zipinstaller to work. I also had to manually add that directory to my system path.

The performance is fine now. Even though it is installed in the Program Files (x86) directory, which I don't have permissions for as a limited user, it doesn't seem to suffer from the same problem. I ascribe this either to the fact that the portable version is a bit more conservative in where it writes/deletes files, which is probably the case, or to the upgrade from 1.7 to 1.8. I'm not going to try to pin down which one is the reason, suffice to say it works much better now.


You might want to try uninstalling msysgit, restart windows, install latest version of msysgit. It seemed to do the trick for me. I found this suggestion here:

https://stackoverflow.com/a/4506192/1413941

EDIT

PS I already had UAC disabled before I ran into slow Git issues, so I don't know if disabling UAC is required or not to get Git going fast.


The best solution is to run as administrator, as pointed out. However another option to make git status fast, at least, is trustctime = false. Before that git status took about 30 seconds and after that it is the same amount that is shown in the output - It took X seconds to...


You might also gain an important performance boost by changing the following git configuration :

git config --global status.submoduleSummary false

When running the simple git status command on Window 7 x64, it took my computer more than 30 seconds to run. After this option was defined, command is immediate.

Activating Git's own tracing as explained in the following page helped me found the origin of the problem, which might differ in your installation : https://github.com/msysgit/msysgit/wiki/Diagnosing-why-Git-is-so-slow


It's probably a matter of the prompt which analyzes your Git repository. You can test by doing "clear" somewhere outside of a Git repository. And you can accelerate it by either patching git-completion.bash or by playing tricks with core.filemode.

As for the Visual Studio integration: This is Open Source. It is unfair to expect others to work for you for free.

I also find it rather funny not to ask the question on the msysGit mailing list, but now I digress.

참고URL : https://stackoverflow.com/questions/2835775/msysgit-bash-is-horrendously-slow-in-windows-7

반응형