How to expose local git repo with git daemon and a tunnel?

Hello everyone, I am exposing my local git repo via git daemon --reuseaddr --base-path=. --export-all --verbose --enable=receive-pack , which serves it under port 9418 , the docs for git-daemon can be found here.

But I had no luck exposing this service, I tried https, tcp but still the same result

git clone git://git.domain.com/repo
Cloning into ‘repo’…
fatal: unable to connect to git.domain.com:
git.domain.com[0: 1xxxx1]: errno=Connection timed out
git.domain.com[1: 1xxxx7]: errno=Connection timed out
git.domain.com[2: 26xxxx65]: errno=Network is unreachable
git.domain.com[3: 260xxxxed]: errno=Network is unreachable

I’ve setup my tunnel in docker and expose the host ports via host.docker.internal (its working because I also use ssh on the same tunnel).

Any idea what the right combination of commands/ config is?

Hi @nikolamilovic2001

Have you added the Private Network IP address for your git repo in the Cloudflare Zero Trust dashboard > Tunnels > yourtunnel > Private network tab?

CJ24N

1 Like