As the title says, is there an extension that allows to run difftool over remotessh but within VSCode? I tried a few plugins but they need --no-index
or setting git worktree
which is not possible to configure AFAIK within VSCode.
I would like to compare and merge using Beyond Compare or Araxis Merge and not use the VSCode diff/merge
2
Answers
VSCode’s Remote – SSH extension does not support running
git difftool
commands on remote machines.There are a few extensions that claim to do this, but they require setting the
git worktree
, which is not possible to configure within VSCode.To compare and merge using Beyond Compare or Araxis Merge, you can use them locally by opening the files in those tools and comparing them to the remote files.
Alternatively, you can use a third-party tool like DiffMerge to run
git difftool
commands over SSH.Steps:
git difftool
.I hope this helps!
Unfortunately, there is no extension that allows you to run difftool over remote within VSCode. The extensions you tried require –no-index or setting git worktree, which is not possible to configure within VSCode.
However, there is a workaround that you can use. You can use the sshfs command to mount the remote directory on your local machine. Once the directory is mounted, you can use the VSCode difftool to compare and merge the files.
Here are the steps on how to do this:
Install the sshfs command on your local machine.
Open a terminal window and navigate to the directory where you want to mount the remote directory.
Run the following command:
The remote directory will be mounted on your local machine.
Open VSCode and open the file that you want to compare.
Right-click on the file and select "Compare with…".
Select the file that you want to compare the first file to.
VSCode will open the difftool.
The difftool will compare the two files and show you the differences. You can then merge the files using the difftool.
Once you are done, you can unmount the remote directory by running the following command: