Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Solution for Git GUI client for remote SSH

Tags:

git

linux

ssh

I am a Git GUI user. I don't have an issue using it for my local development. However, now we have a server with a Git repository. Can I remotely push, pull and diff by using the Git GUI client to access that?

Currently, I am SSHing to the Linux server, and use a Git command to do all the Git commands. But I found it very difficulty when it comes to diff. That's why I think is there any solution for me using the Git GUI client access remote repository and do the Git command with a Git client.

I want to be able to mount a remote server in a Git repository. Current we only have to open the Git repository in our local disk. For example, the C:\www\repo.git file. How about if I want to access 10.10.10.10/home/www/.git and do all the Git commands in the Git client?

Solutions are open for OS X and Windows.

like image 380
Shiro Avatar asked Oct 23 '15 15:10

Shiro


2 Answers

Aside from VNC / remote X (which is an obvious solution and therefore not worth putting in an answer), the only alternative I can find is Visual Studio Code's new remote development support.

You can connect to a server via ssh (from within Visual Studio Code), and then Visual Studio Code's Git features work natively. The interface is fairly basic however - in particular there is no history view and you can't rebase, cherry-pick, etc. from the GUI. It's basically for staging commits.

This extension gives you a proper git graph view. It's pretty good.

like image 143
Timmmm Avatar answered Oct 02 '22 13:10

Timmmm


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 OS X 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 OS X), it gets complicated for Win32. There are tutorials on the web for setting up and using Xservers under Win32 (e.g., Xming).

like image 27
umläute Avatar answered Oct 02 '22 13:10

umläute