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.19k stars 59 forks source link

Usefullness of wslgit - please improve `readme.md` #116

Closed karolzlot closed 3 years ago

karolzlot commented 3 years ago

I would like to understand why anybody would prefer to use git in wsl instead of git in windows, I think the result of commands will be exactly the same.

In readme.md I see description of how this program works and I think I understand it, but there is no explanation why it makes sense to do this in the first place.

Stanzilla commented 3 years ago

Speed. But if you are here asking that question, you're not quite the target audience for it anyway?

karolzlot commented 3 years ago

@Stanzilla I am using separate git in wsl2 and separate git in windows. I asked because if I will benefit I will switch.


Is it really faster as you say? I think it should be slower: when you use Windows filesystem in WSL2, performance is currently very bad: https://github.com/microsoft/WSL/issues/4197

Stanzilla commented 3 years ago

When using WSL2, you should have all your files inside of the container, otherwise it will be slow indeed. Then you'd also want git in the container (or wslgit).

carlolars commented 3 years ago

The main reason that I started using this tool was that Git for Windows doesn't handle the executable bit. So if using Windows-git on a repository in the WSL filesystem then the execution bit was lost at clone/checkout and had to be added to all scripts manually, and later when comitting those scripts then Windows-git ignores the execution bit :/ It was really annoying.

Nowadays you can even have the execution bit set for files on the Windows filesystem by mounting using the "metadata" option, if you use wsl-git, but ofc the performance is not that good for WSL2.

andy-5 commented 3 years ago

Besides the other reasons already mentioned, the original reason for creating the project was to avoid managing two separate installations of Git (Windows and WSL). Using wslgit, you just setup Git inside WSL and also use it from Windows (and tools like VS Code etc.).

Whether you want to use it mainly depends on your workflow and preferences. I think you would probably know it yourself if you have a need for a tool like wslgit. If you are happy with your current setup, you don't have to use it.

I'm closing this issue. Feel free to re-open or to post another issue if you have any further questions.