Use Git "locally" over SSH

Question

our company wants to switch from svn to git/hg.

Our current environment is:

  • Windows-Dev-Machines
  • Remote Linux Server (via 1 Gbit LAN)
  • Samba Share on Server, mapped in Windows

We don't want to work locally, because of backups (serverside) and running VMs on localhost etc (PHP-Webserver).

So I can clone from Server via SSH into the mapped Drive (say Z:\), which is in fact the same Linux machine.

We've got a Repo with around 20k Files, so the git status takes like forever (because it's remote).

Can we tell git/hg (or a client) to also SSH into our Z:\ ?

We also have the idea of running everything on C:\ and syncing it via ssh to the document-root of the server, but it doesn't feel right...


Show source
| git   | mercurial   | ssh   | repository   2017-01-02 17:01 2 Answers

Answers to Use Git "locally" over SSH ( 2 )

  1. 2017-01-02 23:01

    "We also have the idea of running everything on C:\ and syncing it via ssh to the document-root of the server"

    Working with a distributed VCS (Git/Hg) means working locally: those tools have been design to minimize latency: no network connection of any kind (except for clone/pull/push)

    Putting your repo on Z: is acceptable, but working (status, commit, ...) directly on a network drive is not.
    Simply clone your repo on Z: to C:, and work locally. When you are done, push back to the Z: repo. Especially since Git 2.3+, which allows you to push to a non-bare repo.

  2. 2017-01-05 09:01

    If you don't fear the command line, you can use Mercurial or git via SSH on the server. This is much faster, since the tools on the server have the advantage to use there the local file system, instead of squeezing everything through the much slower SMB protocol.

    When you insist of running the client on the windows side, you usually can configure your client to use a different hg/git executable, which you then replace by a script which forwards all commands via ssh to the server. But such solutions tend to be very brittle, and I would advice very much against it.

Leave a reply to - Use Git "locally" over SSH

◀ Go back