opendiff or other merge tool talking with remote machine's Git over ssh

1.4k views Asked by At

How can I use opendiff or other visual merge tools to connect to a remote Linux server over ssh and handle Git merge conflicts with a local visual merge tool?

Can I configure git locally to proxy for the remote server?

2

There are 2 answers

0
Mark Longair On

Probably the easiest way to get what you want is to use sshfs to mount the remote directory, and resolve the conflicts in the file as if it were local. You will still need to mark the changes as resolved (with git add) by running that command on the remote server, however.

I guess from your mention of opendiff that you're using Mac OS. The recommended way to get sshfs on Mac OS used to be macfuse, but it looks as if that is no longer supported, so you might be better off with FuseX. (Only being a very infrequent Mac user, I can't personally vouch for either of those.)

0
tvl On

I had the similar issue then I move my dev environment on lamp.

I change my workflow and now I use PhpStorm (IDE) with remote SFTP and the internal git tools it have. It’s a must more efficient workflow! (most IDEs have similar tools)

As Mark Longair said the sshfs is the best solution if you want to stick with the tools you use to work.

Finally, any method you choose work with private keys. It will make you forget that you work on a remote folder!