1

I currently have a git repo stored on a local network drive. A few windows 10 PCs commit to this repo on a daily basis and access it through the local 'file://' protocol (I do not have admin control over the network so unable to install an actual git server like gitea).

The problem now, is that I would like to have a linux (Ubuntu Desktop 20.04) computer that is connected to the network get access to the git repo (push/pull) on the network drive. I've been told that the network drive does not work well with linux and I don't have any further details about the setup. Given that mounting the network drive on the linux machine is not an option, is it possible to access the git repo by using one of the windows PCs as a proxy? perhaps using an ssh tunnel? I am currently able to ssh/vnc into the linux PC from other windows PCs.

I have seen the following tutorials and a few others, but they all seem to be connecting to an actual git server. I would like this to work with the local 'file://' protocol if possible.

1: git through ssh tunnel

2: use proxy for git/github

I'm open to any viable solution within the limitation of my setup/circumstances. Moving the repo to an online host like github is not an option.

Fiebbo
  • 33
  • 4

1 Answers1

1

they all seem to be connecting to an actual git server

Using an SSH tunnel does not rely on an actual Git (GitLab/Gitea/...) server on the target side.

As long as the repository path is accessible through SSH (try a simple ls, for testing), git operations will work.

Using SSH does not mean using a "Git" server, only the remote side SSH daemon.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • So I was able to clone a repo from my windows pc to the linux pc by running an ssh server on the windows pc and connecting to it from the linux pc and using '**git clone userName@hostIpAddress:absolutePathToRepo**' However, despite being able to cd into the network drive from mingw bash, the clone command doesn't work when I try to use the path to the repo on the network drive (eg: "//NetDrive/repo"), and gives the following error '**fatal: protocol userName@hostIpAddress is not supported**' – Fiebbo Aug 18 '21 at 20:36
  • @Fiebbo What command do you type? Can you try with `git clone ssh://userName@hostIpAddress/full/path/of/repo`? – VonC Aug 18 '21 at 20:48
  • I tried that and now get **fatal: '/full/path/of/repo' does not appear to be a git repository** **fatal: Could not read from remote repository** I also discovered that running mingw locally on the windows pc, I can access the network drive using `cd //NetDrive` but the same command won't work when ssh'ing in from linux – Fiebbo Aug 19 '21 at 00:42
  • @Fiebbo Just to be sure, you did replace `/full/path/of/repo` by the actual full path of your folder repository? – VonC Aug 19 '21 at 06:50
  • absolutely, I think my issue is related to the fact that I cannot cd into the network drive when ssh'ing from linux. but I'm not sure where to even begin trying to troubleshoot this. Could it be a permission issue? I did have to go through some weird [undocumented permission setup](https://stackoverflow.com/questions/16212816/setting-up-openssh-for-windows-using-public-key-authentication/50502015#50502015) for my ssh keys to work on windows openSSH server. – Fiebbo Aug 19 '21 at 16:53