Is there a way to get VS code work with git worktree? (Windows with WSL)

十年热恋 提交于 2021-02-19 01:47:48

问题


I like to keep on repository checked out in several worktrees with git worktree to easily work on different branches simultaneously. Yet VS code does not seem to recognize git as scm when it is in a git worktree folder.

I couldn't find anything in the docs about this or an extension. Are there any ideas on how I could get VS code to support git features in an external worktree?


回答1:


I didn't think this would matter, but it turns out... I'm on Windows and run my git command line in Windows Subsystem for Linux. But obviously, Git on Windows couldn't find the absolute linux path in /mnt/d....

I replaced it with a relative path and now Git on Linux and Git on Windows both report the worktree as being in a git directory. And it works with VS code as well!



来源:https://stackoverflow.com/questions/47076998/is-there-a-way-to-get-vs-code-work-with-git-worktree-windows-with-wsl

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!