I am a GIT GUI user. I have not issue using in my local development. However, now we have a server with GIT repo. I would like to know any solution I can remotely push, pull and diff by using GIT GUI client to access that?
Currenly. I am SSH to the linux server, and use git command to do all the git command. But I found it very difficulty when come to diff. That's why I think is there any solution for me using GIT GUI client access remote repo and do the GIT command with GIT client.
What I want is I able to mount a remote server in a GIT repo. Current we only to open GIT repo in our local disk. eg C:\www\repo.git file, how about I want to access 10.10.10.10/home/www/.git and do all the GIT command in the GIT client.
Solution open for OSX and Windows.
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 needtcl/tk
installed, which means that you also need theX
infrastructure installed). You also must enable Xforwarding, by making sure that you have a line like the following in your/etc/ssh/sshd_config
:To use that on your local linux machine, you would usually use the
-X
flag to enableXForwarding
for a given connection:On your local OSX machine, you would instead use
-Y
You need an
Xserver
running on your local machine, in order to useXForwarding
. 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
)First, when it comes to diff, you can simply git fetch your repo, and do the diff locally (with git gui), since you have the all history.
Second, if you have ssh access to the server, you don't need to actually open an ssh session.
A simple
git command git@gitserver:/path/to/git/project.git
is enough (repalce "command
" with clone/push/pull/fetch)That means the fetch is easy.
See Git on the Server - Setting Up the Server for an ssh setup, at least for Linux or Mac.
For Windows, you have alternative ssh server you can consider, like
copssh-free-edition
.Then you would need to ssh to the server, git add and git commit there in the repo, then go back to your local workstation, clone or fetch, and do the diff there. –