Git无法与vscode remote ssh一起正常工作 [英] Git isn't working as expected with vscode remote ssh

查看:1029
本文介绍了Git无法与vscode remote ssh一起正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近尝试了 vscode的远程SSH功能.设置和连接到远程服务器非常容易.

I recently tried out vscode's remote SSH feature. It was super easy to setup and connect to a remote server.

我将编辑器打开到一个git repo的目录中,并期望它具有默认的git功能,就像正常工作一样.但是,如果我编辑文件,则vscode不会显示文件中有修改的视觉指示. git选项卡不显示更改.我可以在vscode中打开终端并运行git status,事实上我确实看到了更改,因此我知道这实际上是在编辑文件.

I opened the editor to a directory that is a git repo and expected to have the default git features working like normal. But if I edit a file, vscode isn't showing the visual indication that there is a modification in the file. And the git tab doesn't show the change. I can open the terminal in vscode and run git status and I do in fact see the change so I know that's actually editing the file.

如果我进入服务器并运行git status,我确实注意到vscode更新了,现在在git选项卡中显示了更改.但是更改后的实际文件中的行号旁边仍然没有视觉指示.

If I ssh into the server and run git status I do notice that vscode updates and now shows the change in the git tab. But there's still no visual indication next to the line number in the actual file that is changed.

推荐答案

原来,我的问题是我正在打开VSCode到远程服务器上的符号链接目录.如果我改为将其指向实际目录,则一切正常!

Turns out my problem was that I was opening VSCode to a symlinked directory on the remote server. If I instead pointed it to the actual directory everything worked fine!

@depontimatteo的答案可能仍然有用,如果有人正在使用大型代码库遇到此问题.

@depontimatteo's answer might still be relevant if someone is running into this problem with a large codebase.

这篇关于Git无法与vscode remote ssh一起正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆