4 ms·
Ask HN: Is anyone using any headless Git service?
Basically an api server for git, like Github API without public facing stuff (also excluding endpoints for its public facing stuff like issues/pull requests etc), only git related endpoints.
I believe there should be at least one .. but I didn't find any. Only found self-hosted git even though some have api.
So I think you know what I mean by "headless".
- pmontra 4y agoNot sure if it's what you're looking for but I self host gitolite on a VPS. Access and auth control is via ssh keys on its user on the server and its script there. Administration is via a git push. There are only git repos, no GUI. Git is the API.
- Existenceblinks 4y agoI just look into the gitolite but it doesn't have API. To clarify, what I mean is REST style API via http.
- notwokeno 4y agoDoes git actually let you push over http? I'd imagine that's the same as using ssh/sftp just with WebDAV. If it's the same just create a bare repo in a directory your web server has access to.
- Existenceblinks 4y agoI haven't looked into it but I don't think it's enough to build app on top. Otherwise there wouldn't be a bunch of libgit2 binding. Github is basically building around libgit2 (Rugged) and some of its custom stuff + collaboration UI. It's quite surprising no one has ever built libgit2 as a api service .. yet.
- pmontra 4y agoSo maybe Gitea is what you are looking for. It can be self hosted and they have an API. Links to the documentation from here https://docs.gitea.io/en-us/api-usage/ https://docs.gitea.io/en-us/api-usage/ It's not headless but maybe there is a way to shut down the HTML interface. But probably the same could be said of GitLab.
- pkd 4y agoSomething like the Gitea API? https://try.gitea.io/api/swagger https://try.gitea.io/api/swagger I don't know if you can run it purely headless.
- Existenceblinks 4y agoNo. Something like this: https://docs.github.com/en/rest/git/trees?apiVersion=2022-11-28#get-a-tree https://docs.github.com/en/rest/git/trees?apiVersion=2022-11...
- pkd 4y agoI actually don't see what's special with that compared to any other API. Here's the analogous endpoint from the Gitea API docs: https://try.gitea.io/api/swagger#/repository/GetTree https://try.gitea.io/api/swagger#/repository/GetTree
- Existenceblinks 4y agoTrue. Though I mean it's not specially git api. There are just a few endpoints. And somewhat tie to the service's db such as branch. It's like a afterthought of ui centric.
- cdaringe 4y agossh myserver -c “git init” && git remote add origin git@myserver && git push origin HEAD. headless git is just ssh to a sever with an associated repository, ya? What else do you need?
- Existenceblinks 4y agoThat and a programmable interface .. API endpoints.