Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a way to get a compact list of all git repositories managed by gitosis.

I'm looking for something similiar to

svn list url_to_repo

I know that I can have a look at gitosis.conf, but that's to wordy.

share|improve this question

As far as I know you can't check what repositories you have access to with gitosis, without checking the gitosis.conf file or without access to the gitosis repo dir (either remote or local)

You should use gitolite to fulfill that need.

Gitolite is easy to install and the usage is almost the same as gitosis (single user access, using a repository with a config file and keydir to configure the service, etc), but it allows setting permissions per branch (if you need to), sync with gitweb, and a bunch of other options (a lot of them actually!)

The best part is that you can send the 'info' command to the server using ssh and it will list the repositories you have access to.

e.g: The command

anUser@computer> ssh git@my-git-server info

Will show in the screen something like

hello anUser, the gitolite version here is v1.5.7-4-g270e0b9
the gitolite config gives you the following access:
     R+  W  Repo1
     R   W  Repo2
     R      Repo3
    @R_ @W_ testing
share|improve this answer
up vote 3 down vote accepted

I put the following code into my .bashrc:

function repos
   awk 'BEGIN { OFS = "[] "; ORS = "\n" } 
        /repo/ {print $2}' "$gitosisDir/gitosis.conf" | sed 's/[][]//g'

Now I can just type repos and get a handy list of all repositories defined in gitosis.conf.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .