How to connect Git GUI client (GitKraken) over SSH

Viewed 1734

Right now I'm working on a project on a remote machine. My laptop runs Windows, and the project needs to be on Linux to run, so it's easier to test this way.

I am coding via SSH over Visual Studio Code (https://code.visualstudio.com/docs/remote/ssh-tutorial). I've just been SSHing in for git, and using the CLI, but I would like to start using a GUI client on this project. Is there any way to connect GitKraken (or another GUI client) to my remote machine over SSH, without cloning it locally?

1 Answers

You could use VNC for GitKraken, but here are the instructions for Git GUI:

https://stackoverflow.com/a/33424668 ———

if your server has it enabled, you can use XForwarding to display a GUI executed on the remote machine on your local machine.

On the server-side, this means that you need to have the proper tools installed (e.g. git-gui, which means that you also need tcl/tk installed, which means that you also need the X infrastructure installed). You also must enable Xforwarding, by making sure that you have a line like the following in your /etc/ssh/sshd_config:

X11Forwarding yes

To use that on your local linux machine, you would usually use the -X flag to enable XForwarding for a given connection:

 shiro@local:~$ ssh -X gituser@gitserver
 gituser@gitserver:~$ cd repo.git
 gituser@gitserver:~/repo.git$ git gui

On your local OSX machine, you would instead use -Y

 shiro@applejoice:~$ ssh -Y gituser@gitserver
 gituser@gitserver:~$ cd repo.git
 gituser@gitserver:~/repo.git$ git gui

You need an Xserver running on your local machine, in order to use XForwarding. While this is not a problem on linux (or OSX), it get's complicated for W32. There are tutorials on the web for setting up and using Xservers under W32 (e.g. Xming)

Related