Search code examples
visual-studio-codevscode-remote

Git isn't working as expected with vscode remote ssh


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

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.

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.


Solution

  • 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's answer might still be relevant if someone is running into this problem with a large codebase.