How to list all available repositories on a Git server via ssh 12

ssh [email protected] info

The above ssh call will connect to a Git hosting server that has gitolite installed and will return the list of repositories that are available to your account along with the access rights of each.

Note: This command should work even if remote login via ssh is blocked on the server.

The command should return a list similar to this:

hello bytefreaks, this is git@git running gitolite3 v3.5.3.1-1-gf8776f5 on git 1.7.1

 R W	Repo1
 R W	Repo2
 R W	Repo3
 R  	Repo4

The first column in the results is the read flag, the second the write flag and the third column is the name of the repository.

In order to clone (get a local copy) a repository from the above list (for the example lets use Repo1) you have to issue the following command

git clone ssh://[email protected]/Repo1

To clone all of the repositories in the current directory with one command, as it is shown in this guide, issue the following command:

ssh [email protected] info | cut -f 2 | tail -n +3 | xargs -I {} -n 1 git clone ssh://[email protected]/{}

This post is also available in: Greek

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

12 thoughts on “How to list all available repositories on a Git server via ssh