Git isn't working as expected with vscode remote ssh

断了今生、忘了曾经 提交于 2019-12-11 18:05:21

问题


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.


回答1:


Follow the instructions at this link, I've changed the value of fs.inotify.max_user_watches in /etc/sysctl.conf and everything was ok.




回答2:


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.



来源:https://stackoverflow.com/questions/57331868/git-isnt-working-as-expected-with-vscode-remote-ssh

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