tags:

views:

95

answers:

2

Supposing I have two machines setup:

Client

  • Let's assume a windows box
  • Let's assume this is a dev box, so all of the files to be put under source control will be here
  • Let's assume no source control installed here

Server

  • Let's assume a linux box
  • Let's assume Git is the source control of choice (installed)
  • SSH enabled

Question: Is it possible to connect from the client to the server, let's say over SSH for the sake of argument, and invoke the Git commands once logged into the server, but on the files of the client (local) system?

e.g. SSH client (only ssh) ----- SSH Server (ssh and git installed here)

            send command --> command: checkout to <client path>
            send command---> command: check-in from <client path>

Rationale: In other words, rather than installing a software client for the VCS, I'd like SSH to act as the enabler; In the case of Git, although mysys for git and cygwin solutions both exist, each has its own drawbacks -- So I'd like to compile/setup the full-featured version on a Linux box, but still allow source control to happen from windows.

Is this possible? (doesn't have to be SSH, any protocol will do, as long as it doesn't require a software client of the VCS)

Could I ssh to the server, mount the client path to the source files, then perform the version control commands on all files of that path?

+1  A: 

Could I ssh to the server, mount the client path to the source files, then perform the version control commands on all files of that path?

Yes, you could, very easily. Take a look at SAMBA for Linux or install Windows Services for Unix and have the client box act as a NFS server; either way would do it.

As far as linux applications are concerned, if it is mounted under / then the fact it has to go over a network to reach the files is irrelevant - the file system drivers take care of that bit.

Thus, yes, if you mounted c:\mysource on your linux server as /mnt/windows/c/mysource there is no reason you cannot use git as on the linux box on files in that directory. The results will of course be transferred over the network.

Ninefingers
Thanks for the confirmation/additional info! I will give it a shot.
CT
A: 

In addition to Ninefingers' answer, if the remote machine cannot reach the client machine directly, you can use SSH port forwarding. This feature is available in OpenSSH, Putty, and many other clients.

Normally, you use port forwarding to access a service on the network of the remote machine. For example, to access the HTTP service on 10.0.0.4 in the remote SSH server's network, you'd do:

ssh -L 8888:10.0.0.4:80 user@remotehost

And then, access localhost:8888 with a browser on the client machine.

However, you can use the same in reverse, and make a local service available to the remote machine. For Windows shares (SMB), you could try the following:

ssh -R 9445:localhost:445 user@remotehost

(You should find the equivalent option in whatever SSH client you're using in Windows.)

And then mount the share somewhere, from the remote shell:

mount -t cifs //localhost:9445/SomeShare /mnt/mountpoint

I must add that I did not test this personally, but it's worth a shot.

Shtééf
thanks for the info, I will give it a shot, in addition to Ninefingers' answer.
CT