9

I was told to clone the repository bar with this command:

git clone git@server:foo/bar

I know that there are other repositories under server:foo (e.g server:foo/dummy, server:foo/ihategit, server:foo/xxx and so on). I have permission to access these repositories, but I don't know their names.

Is there a way to list all the repositories under server:foo?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
lornova
  • 6,667
  • 9
  • 47
  • 74
  • You want to list projects that are not in the repository bar? – Joël Salamin Sep 01 '14 at 13:43
  • 1
    @JoëlSalamin: I have to list the projects under foo. For example foo/aaa, foo/bbb and so on. I don't know the names of those projects, I only know about foo/bar. – lornova Sep 01 '14 at 13:45
  • 2
    If bar is a git repository, it has absolutely no idea of the other projects that are hosted on the same server (every git repo is independant). – Joël Salamin Sep 01 '14 at 13:47
  • 1
    Isn't the repository of my example "server:foo"? – lornova Sep 01 '14 at 13:49
  • No, in your example the git repo is bar (the repo contains a `.git` folder responsible for the entire versioning of the repo, a `.gitignore` if needed,...) but you're in the root of your repo in bar. – Joël Salamin Sep 01 '14 at 13:51
  • 1
    If `bar` is the repository, then what is `foo`? And how do I list all the repositories or whatsoever that are in `server:foo`? – lornova Sep 01 '14 at 13:53
  • I don't know the structure of your server but it may be possible that bar is a sub-repository and in this case you'll be able to `git clone`foo. If you're able to clone the foo repository, you're problem will be solved and you'll see the entire hierarchy of your main repo – Joël Salamin Sep 01 '14 at 13:57
  • 1
    @JoëlSalamin: that was my first idea, but foo is HUGE. I'd like to avoid to clone a terabyte of stuff... is there a way to check if it at least would work, without actually cloning it? – lornova Sep 01 '14 at 13:59

2 Answers2

3

It seems like you want to view the collection of that "users" repositories.

On GitHub, for example, this is similar to going to https://github.com/foo?tab=repositories

It will depend on which interface the server is using and whether or not they implement a view that is similar to GitHub's. GitLab by default has no such view, has a similar view, for example: https://gitlab.com/gitlab-org would have a view of all repositories that you have access to. (If the server were Bitbucket and the user were foo, then https://bitbucket.org/foo.)

In the case of a private server, this answer may shed more light.

vgoff
  • 10,980
  • 3
  • 38
  • 56
  • 1
    Why the downvote, after the original question was edited and my answer was edited by not me? – vgoff Nov 08 '19 at 16:17
  • Edited the comment to update Gitlab repositories listing information. – vgoff Nov 08 '19 at 16:26
  • I downvoted because this does not answer the question. This simply does not list all git repositories on a general git server, but only describes the interface of three proprietary website frond-ends. My action has nothing to do with any edits, all of which are cosmetic. – BrtH Nov 19 '19 at 10:12
  • I did not read the question which states "browse" as a "general git server" so you are correct, only as an unspecified one. The question does not specify the git hosting, and so it was difficult to answer this, as some servers don't have a browser interface. The original poster did not downvote, so I had for years thought it wasn't an inappropriate answer. I will try to improve it. – vgoff Nov 19 '19 at 18:02
2

The Stack Overflow post Browse Git repository without cloning may help you. If you want to list a remote repository without having to clone it locally, you'll need to connect through SSH in order to access it from the server:

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Joël Salamin
  • 3,538
  • 3
  • 22
  • 33
  • 2
    Hmm, I can not get anything useful. However it seems that server:foo/bar is the repo, and that I can't access server:foo to list its content. Perhaps this answer is relevant: http://superuser.com/questions/379325/is-there-way-to-list-all-existing-repositories-using-git – lornova Sep 01 '14 at 14:16
  • 1
    `server:foo/bar` is for sure a git repo because you're able to clone it locally. The remote SSH connection seems to be the only solution to have the entire list of available repos (except if you've a tool like GitLab to manage your remote git repositories). – Joël Salamin Sep 01 '14 at 14:23