Is it possible to use git daemon with a repository that has LFS setup on it? I have a machine that isn't able to connect to my corporate VPN (no Linux client), and I must share a repository with it to try out Linux specific changes to my code.
I have:
- Mirrored the repository locally on the Windows machine.
- Run
git daemon --export-all --enable=receive-pack --reuseaddr(one directory up from the mirror) - Added a remote for this on the Linux computer, cloned, and made some changes to files tracked with
git lfs track. - When I try to
git push <remote>back to the Window machine, I get errors with LFS.
The errors:
Git LFS: (0 of 1 files) 0 B / 981.15 KB
Post https://192.168.2.12/repository.git/info/lfs/objects/batch: dial tcp 192.168.2.12:443: i/o timeout
Post https://192.168.2.12/repository.git/info/lfs/objects/batch: dial tcp 192.168.2.12:443: i/o timeout
error: failed to push some refs to 'git://192.168.2.12/repository.git'
If I make edits to files that are not tracked under LFS, that works just fine. I'm assuming this is because git is also expecting some sort of LFS server on the Windows machine. Is there some way to get LFS to work in this case, or is this just unsupported with git daemon?
Currently
git daemondoes not offer integrated LFS server support.I could not find anything related in the git mailing list (and it might be worth trying there), but there's an official answer on a git-lfs repo issue:
As long as the default url/port for the LFS server is different from the GIT one, you can run the reference LFS server. If it's not of course it's more trouble. In that issue discussion you'll find some details, but in summary:
you can always set the LFS url:
git config lfs.url LFSURLyourself to point to your LFS server. It can even be done directly on the clone:git -c 'lfs.url=yourlocallfsserver' clone yourlocalgitserver/repo.It would be nice if either
git daemonor the lfs server could offer a 'routing' service (as suggested by ttaylorr) to redirect requests to the appropriate server, but it's not possible right now with those tools.There are though a few tools listed on the git-lfs implementations page that seem to offer combined git and lfs support, for instance gitbucket.
I haven't tried them, but one could be a valid alternative to git daemon.