Zig fetch ssh+git?

Is there a way to zig fetch a repo over ssh and not http?

I typically use git over ssh, so to use my own zig repos as
modules I have to mirror them to codeberg.

1 Like

Relevant issues:

2 Likes

awesome that’s helpful, thx!

Oh, and just in case you’re unaware, Zig has moved to Codeberg, so those issues won’t receive updates on github. New issues will be created on codeberg when an older github issue needs to be updated.

1 Like

In the mean time, you can use git-http-backend to serve your repositories. It is included with git and is a simple CGI script that provides the git http protocol.

In my server I am using nginx to handle https for clone and fetch without authentication.
Related nginx configuration:

        location ~ /git(/.*) {
                include fastcgi_params;
                fastcgi_param SCRIPT_FILENAME /usr/lib/git-core/git-http-backend;
                fastcgi_param GIT_PROJECT_ROOT /home/git;
                fastcgi_param GIT_HTTP_EXPORT_ALL "";
                fastcgi_param PATH_INFO $1;
                fastcgi_pass unix:/run/fcgiwrap.socket;
        }

I also use https remote fetch url for git clone/fetch and ssh remote push url for git push.

1 Like