Reputation: 96541
Is there a simple way to know what repos one has access to on origin? I know some tools provide this information, but i am looking for a command line solution.
Upvotes: 3
Views: 147
Reputation: 3557
can you try : ssh git@<ip>
ssh
is a command located in the folder <git installation folder>/bin
.
Upvotes: 1
Reputation: 5277
origin
, assuming you mean the name of the remote that's crated on clone (as it's just a name, which you can change) is just the one repository.
If what you want to know is how many other repositories you have access to on the same server, then the answer depends completely on what's managing the git repositories there.
For example, gitolite will show you a list when you try to ssh into the computer, so e.g. ssh git@host
would give you a human-readable list with the permissions your user has. More complex systems like GitHub, Gitorious etc. provide a RESTful API tools can talk to, but there is no unified way of providing this information.
Upvotes: 2
Reputation: 70245
The word 'origin' is a GIT name for a remote. You can see the actual remote using:
git remote show origin
which will print something like:
ebg@ebg(64)$ git remote show origin
* remote origin
Fetch URL: ssh://ebg@tsuki/Users/ebg/repo/kg.git
Push URL: ssh://ebg@tsuki/Users/ebg/repo/kg.git
HEAD branch: master
Remote branches:
master tracked
The URL listed tells you where the repository is located; in my case, on a machine called 'tsuki'.
So, your question, how many repos are on 'tsuki' that I have access to? Generally unknowable - because a repo is just a location in the file system that I can read. Perhaps you could try something like:
find / -name 'HEAD' -print
Upvotes: 1