Is it possible to use VScode as a remote editor for git?

Viewed 489

The setup is the following:

A windows machine with VS code installed.

A Linux machine where the code is.

I connect with the VS code to the Linux machine.

Can the git on the Linux machine use the remove VS code as an editor?

Found this link but it did not say how to do such configuration: https://github.com/microsoft/vscode-remote-release/issues/933

Also this link did not helped me: https://github.com/roiderats/vscode-remote-remote

I tried from the VS code terminal the following command: git --mergetool -t "code --wait" but I get the following output: Unknown merge tool code --wait

I tried from the VS code terminal the following: git config --global core.editor "code --wait" Git tries to use vim as editor.

2 Answers

It seems that my mistake was that a gave the git difftool or git mergetool command from the Linux machine at that caused the error: Unknown merge tool code --wait

Solution: Give the git difftool or git mergetool command from the terminal in VS code. It will work then.

Follow this link for the settings: https://www.roboleary.net/vscode/2020/09/15/vscode-git.html

The default practice when working with Git would be to install Git for Windows on your Windows machine, clone the repo to the Windows machine and then edit the git repo directly on the Windows side.

You can of course set up a SAMBA-share on the Linux side to access the Git-repo remotely using VS Code on your Windows machine.

But this is frowned upon in the latest git client versions that will give you warnings when not working with cloned repos stored in your user profile ~.

Related