List of remotes for a Git repository?


I have a Git repository. This repository has multiple remote repositories (I think). How can I get a list of the remote repositories that belong to said repository?

Like git list --remotes or something like that?

  • Translate

    You can get a list of any configured remote URLs with the command git remote -v.

    This will give you something like the following:

    base    /home/***/htdocs/base (fetch)
    base    /home/***/htdocs/base (push)
    origin*** (fetch)
    origin*** (push)

  • Translate

    If you only need the names of the remote repositories (and not any of the other data), a simple git remote is enough.

    $ git remote

  • Translate

    FWIW, I had exactly the same question, but I could not find the answer here. It's probably not portable, but at least for gitolite, I can run the following to get what I want:

    $ ssh info
    hello akim, this is gitolite 2.3-1 (Debian) running on git
    the gitolite config gives you the following access:
         R   W     android
         R   W     bistro
         R   W     checkpn

  • Translate

    The answers so far tell you how to find existing branches:

    git branch -r

    Or repositories for the same project [see note below]:

    git remote -v

    There is another case. You might want to know about other project repositories hosted on the same server.

    To discover that information, I use SSH or PuTTY to log into to host and ls to find the directories containing the other repositories. For example, if I cloned a repository by typing:

    git clone ssh://

    and want to know what else is available, I log into via SSH or PuTTY and type:

    ls /git

    assuming ls says:

     ABCProject DEFProject

    I can use the command

     git clone ssh://

    to gain access to the other project.

    NOTE: Usually git remote simply tells me about origin -- the repository from which I cloned the project. git remote would be handy if you were collaborating with two or more people working on the same project and accessing each other's repositories directly rather than passing everything through origin.

  • Translate

    A simple way to see remote branches is:

    git branch -r

    To see local branches:

    git branch -l