Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Git: Support WSL #9502

Closed
tianvan opened this issue Jul 19, 2016 · 110 comments
Closed

Git: Support WSL #9502

tianvan opened this issue Jul 19, 2016 · 110 comments
Labels
feature-request Request for new features or functionality git GIT issues help wanted Issues identified as good community contribution opportunities verified Verification succeeded WSL Issue when using WSL
Milestone

Comments

@tianvan
Copy link

tianvan commented Jul 19, 2016

qq 20160720033734

@kieferrm kieferrm added the feature-request Request for new features or functionality label Jul 20, 2016
@joaomoreno joaomoreno added this to the Backlog milestone Jul 21, 2016
@joaomoreno
Copy link
Member

joaomoreno commented Jul 21, 2016

This was fast. The thing literally came out yesterday for everyone.

Actually, it's still not yet out, so support for this will take its time.

@joaomoreno joaomoreno changed the title Only support Git for Windows,Please support Git for Bash on Ubuntu on Windows Support Git for Bash on Ubuntu on Windows Jul 21, 2016
@johnbwoodruff
Copy link

It would be great to use Bash on Ubuntu on Windows as the integrated terminal! Not to mention its git installation for the git tab. I can't +1 this enough! :)

@johnbwoodruff
Copy link

Noticed that we can use the Bash on Ubuntu on Windows terminal in the integrated terminal now. That's awesome! Now we just need the git integration with the git version installed through bash on ubuntu on windows.

@dalyIsaac
Copy link

+1

@joaomoreno joaomoreno removed their assignment Sep 19, 2016
@ncarroll
Copy link

+1

1 similar comment
@nmbradford
Copy link

+1

@joaomoreno joaomoreno added the help wanted Issues identified as good community contribution opportunities label Oct 20, 2016
@jonomacd
Copy link

This would be great not just for git but for extensions as well. I use the vscode-go extension and it shells out to use the command line tools often. I'd like it if it could shell out to bash as opposed to windows terminal. It would also need access to environment variables from bash. Basically, I want it to think it is in a bash environment even though it is in windows.

Thanks.

@ElieMyIdea
Copy link

+1

6 similar comments
@andre2
Copy link

andre2 commented Aug 31, 2017

+1

@doxiaodong
Copy link

+1

@lobabob
Copy link

lobabob commented Sep 25, 2017

+1

@emmanuelvlad
Copy link

+1

@kidpollo
Copy link

+1

@mikaelbalin
Copy link

+1

@bpasero bpasero added the terminal General terminal issues that don't fall under another label label Nov 11, 2017
@joaomoreno joaomoreno added the WSL Issue when using WSL label Nov 17, 2017
@lugolven
Copy link

+1 :)

@sgiradoa-psl
Copy link

+1

@joaomoreno joaomoreno changed the title Support Git for Bash on Ubuntu on Windows Git support for WSL Nov 20, 2017
@skippednote
Copy link

@joaomoreno Wanted to check if there any work being done on this WSL git + VSCode integration?

@nickjj
Copy link

nickjj commented Feb 8, 2019

Keep in mind if you go with the wslgit.exe approach, it works but it's deadly slow. So slow that it's completely unusable (even when things outside of Git was very fast).

@phifa
Copy link

phifa commented Feb 11, 2019

@joaomoreno is a native integration in VSC planned?

@developerruhul
Copy link

It's 2019.. It's been about 3 years since this issue was brought up... We see no progress at all.

Git with vscode is the only reason I am in linux.. using wsl and git for windows together causes some crazy problems like losing permissions on some folders/files. So please vscode guys do something.

@mmirus
Copy link

mmirus commented Feb 14, 2019

I know it's not a permanent solution but if you haven't tried wslgit with vscode, give it a shot. It's stable and performs quite well for me.

@phifa
Copy link

phifa commented Feb 14, 2019

Well I think a heads up would be good. Is it being worked on? Can we contribute or test? Don’t leave us in the dark 🙂

@pd93
Copy link

pd93 commented Feb 15, 2019

@phifa I think @mmirus is referring to https://github.com/andy-5/wslgit which is an unofficial workaround.

Edit: Some have reported that it's quite slow compared to using Git for Windows, so I still prefer to have both Git for Windows and WSL installed. Only downside is that I have to ensure my SSH keys and .gitconfig are replicated.

Would obviously prefer to stop using Git for Windows though!

@benc-uk
Copy link

benc-uk commented Feb 18, 2019

wslgit is slow as hell and it's a cludgy workaround.

Also SCM/git is just one part of the WSL integration we need from VSCode

@ChristianGrimberg
Copy link

Figured it out by using this : https://github.com/andy-5/wslgit
Works great for me 👍

WSL & Git & Visual Studio Code without Git Bash

@phifa
Copy link

phifa commented Mar 14, 2019

@joaomoreno any updates on this?

@llatseattle
Copy link

Any update on this?

@andreialecu
Copy link

wslgit is not slow at all in my experience if set up properly.

Just remember to set the WSLGIT_USE_INTERACTIVE_SHELL variable in Windows to false, see the documentation in its README.

@panoscool
Copy link

the integrated terminal is working fine with the wsl the issue is the vscode git sidebar is not working at all with the wsl

@quhung1989
Copy link

quhung1989 commented Apr 2, 2019

@panoscool This is what I did to resolve the side bar issue. I opened "Git Bash" in Windows and and ran:

git config --global core.excludesfile '/the/absolute/path/to/your/global/git/ignore'

So currently Git Bash and WSL are referencing the same ignore file globally. I was not sure how Git Bash handles absolute paths so I did "cd ~" and "$PWD" and it returned "/c/Users/username".

@RMacfarlane
Copy link
Contributor

We just announced remote development with VS Code, check out the blog post for details https://code.visualstudio.com/blogs/2019/05/02/remote-development

@RMacfarlane RMacfarlane modified the milestones: Backlog, April 2019 May 2, 2019
@xty
Copy link

xty commented May 3, 2019

We just announced remote development with VS Code, check out the blog post for details https://code.visualstudio.com/blogs/2019/05/02/remote-development

@RMacfarlane Thank you for the heads-up. It really looks great! I have one question though:
Now with the Visual Studio Code Remote - WSL extension in action, will VS Code automatically pick up the Git installation in WSL or do we have to manually configure "git.path" in the WSL specific settings?

Update [2019/05/03]: Upon investigation, it appears Git installation in WSL is picked up automatically. This is awesome🎉!

@benc-uk
Copy link

benc-uk commented May 3, 2019

It automatically finds git from the WSL system path, no need to configure anything

@12101111
Copy link

12101111 commented May 3, 2019

With remote-wsl extension, vscode will use toolchains in wsl, but sometimes we just want to use git in wsl and continue to use the toolchain in Windows.
图片

@andreialecu
Copy link

One probably helpful piece of information regarding the new Remote - WSL extension, which I needed to do in my project:

If you open your folder from the windows path, like you used to - such as from your recent projects menu, the extension won't kick in - everything will still be in Windows mode.

What I had to do was to use Remote-WSL: Open Window, then the File > Open Folder... menu will show you Linux paths, so you need to browse for your folder from there (/mnt/...) and open that instead.

After doing this the git used by Code will be the native one from WSL, and your terminal windows will also use bash by default.

@panoscool
Copy link

@andreialecu if you open the project from wsl terminal using code . wsl Git is working right?

@andreialecu
Copy link

andreialecu commented May 6, 2019

@panoscool code-insiders . doesn't seem to work properly from the WSL terminal. It still opens via the Windows path, meaning the extension doesn't kick in - so you don't get WSL Git or any other WSL capabilities.

It also prints an error to the console, which code . doesn't:

 $ code-insiders . 
/c/Users/<snip>/AppData/Local/Programs/Microsoft VS Code Insiders/bin/code-insiders: line 29: cmd.exe: command not found

Opened #73330

EDIT: Actually, it does work if you have /c/Windows/System32 in your PATH (which would be there by default), but I disabled Windows path propagation into WSL. I posted a workaround in the issue opened above.

@andreialecu
Copy link

My experience after a few days with Remote-WSL (valid May 2019):

I went back to using wslgit on stable Code. While Remote-WSL is extremely promising, I kept running into file system issues, such as various EACCES errors, and even hard lockups because of the NTFS<->WSL file access issues and VS Code was exacerbating them as well.

One example (using React Native) was weird lockups of the Android emulator in Android Studio that could only be resolved by a computer reboot. Additionally, Android Studio would rarely build the project without complaining about being unable to replace some file because of access denied issues. Had to randomly close/reopen Code to try to get past these errors.

One other annoying thing for example is that you are unable to rename a directory after opening it via Remote-WSL. It's a known limitation, among others listed here: https://code.visualstudio.com/docs/remote/wsl#_common-limitations-in-wsl

These will all likely be resolved once WSL 2.0, which was just announced, goes live. It should hit the Windows Insider channel in late June: https://devblogs.microsoft.com/commandline/announcing-wsl-2/

In the mean time, wslgit, while it has its quirks, is currently less of a hindrance to work with.

@aeschli
Copy link
Contributor

aeschli commented May 8, 2019

Thanks for the feedback, @andreialecu. Yes, the fs locking issues are nasty. As you said, they will only go away with the VM2 mode. In some cases you can work around the issue by defining watcher excludes ('files.watcherExclude") for folders where other tools work (e.g. node_modules...)

For the cmd issue you created microsoft/vscode-remote-release#170, thanks!

@aeschli aeschli added the verified Verification succeeded label May 8, 2019
99linesofcode added a commit to 99linesofcode/dotfiles that referenced this issue May 12, 2019
By default, VS Code makes use of Git installed under Windows which
causes changes to the file permissions even though WSL mounts the linux
filesystem with its own file permissions. andy-5/wslgit forwards all
arguments to git running in WSL:

https://github.com/andy-5/wslgit

Just a few days ago, Microsoft announced that they are working on Remote
Development using VS Code which, together with WSL 2.0 which is
scheduled to be released in June of this year dramatically improves
working on source code that lives under WSL or inside a container.
Awesome stuff!

microsoft/vscode#9502 (comment)

As with any new technology, it is not without bugs so it is worth
waiting a little while longer before adopting as the comment below
points out:

microsoft/vscode#9502 (comment)
@vscodebot vscodebot bot locked and limited conversation to collaborators Jun 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality git GIT issues help wanted Issues identified as good community contribution opportunities verified Verification succeeded WSL Issue when using WSL
Projects
None yet
Development

No branches or pull requests