1

I'm using VS Code and a workspace on a Windows network drive via SSHFS. There's no issue here, it works without any problem.

However, I've decided to version my code and finally start using Git. I've created my first repository and via SSH on my remote machine, I did a "git init". VS Code immediately detected that my project was a Git repository, but the default functions are not working. I'm getting an error message like this in the console:

2023-04-06 09:30:16.665 [info] > git ls-files --stage -- Z:\site\monfichier.php [3351ms]
2023-04-06 09:30:16.665 [info] fatal: Z:\site\monfichier.php: 'Z:\site\monfichier.php' is outside repository at '//sshfs/USER@IP!PORT/'

It seems that VS Code is not working on the relative path of the project but the absolute path, and the Windows drive is not the same as the SSHFS root.

How can I fix this issue?

starball
  • 20,030
  • 7
  • 43
  • 238
Thomas
  • 19
  • 2
  • 1
    Could you create a workspace inside that repo folder, and [mount the remote workspace](https://github.com/SchoofsKelvin/vscode-sshfs#remote-workspace-folders) through its SSHFS path? – VonC Apr 06 '23 at 10:30
  • Make sure that the repo is at the top level of your project files, and that you can run the same commands outside of VS Code. – ryanwebjackson Apr 06 '23 at 12:28
  • @VonC, my repo is my workspace and the SSHFS root path. User for connection can have SSH permission – Thomas Apr 11 '23 at 06:38
  • @ryanwebjackson My project is on the root, not subfolder. I can not change this – Thomas Apr 11 '23 at 06:39
  • @Thomas What happens if you run "git status" outside of VS Code in the mapped directory here?: Z:\site\ – ryanwebjackson Apr 11 '23 at 13:36

0 Answers0