andy-5 / wslgit

Use Git installed in Bash on Windows/Windows Subsystem for Linux (WSL) from Windows and Visual Studio Code (VSCode)
MIT License
1.18k stars 59 forks source link

Slow performance #79

Closed robertgeb closed 5 years ago

robertgeb commented 5 years ago

Hi,

First thank you for this simple but useful tool. I'm recently having a annoying problem that I'm not sure if it's from this tool or something else. When i use any git command on bash the performance is normal. But when i use the git interface of VS Code with the wslgit.exe the commands takes too long to complete. I would like to know if anyone else is having this problem or if someone knows how to solve it.

andy-5 commented 5 years ago

One reason might be that wslgit.exe, per default, runs git through an interactive bash shell. This typically means that your .bashrc file is executed for every single git command, which can slow things down, especially if your .bashrc does many things.

A possible solution is described here: https://github.com/andy-5/wslgit#advanced-usage By setting the Windows environment variable WSLGIT_USE_INTERACTIVE_SHELL to 0 you can force wslgit to not use an interactive bash shell. This way, .bashrc is not executed at all or returns early in most default configurations.

Please report back if this helps in your case.

robertgeb commented 5 years ago

Man, you got this. Thank you...

My .bashrc was runing a init-nvm script very slowly.