Is there any way to perform small low-maintenance readonly Git queries with Gitosis?

50 views Asked by At

We are moving our Git repos from plain Git/SSH to Gitosis for security reasons.

One benefit of plain Git/SSH is that any user can SSH into the Git server and perform a readonly Git query without requiring a full local clone.

For example, if I want to find the commit hash of the master branch (but nothing else), I can run:

ssh gitserver 'cd /path/to/repo && git rev-parse master'

This is extremely useful if the full repo is very large and I only want to find out a few small well-defined pieces of information.

If we move the git repo to Gitosis, the SSH method will no longer be possible. Is there any other way for a non-privileged user to perform a small readonly query without having a full clone of the repo? Thanks.

1

There are 1 answers

0
VonC On

Use Gitolite instead of Gitosis (which is stale since 2009).

That way, you benefit from gitolite commands which allows to perform various operations without having to ssh to the server.
You can define your own "non-core" commands which will allow you to perform any operation you want (while respecting the ACL you have defined, which means you won't be able to perform those commands on repos you don't have access to, as defined in the gitolite.conf file)