2

Is there any way to list all the remote as well as local repositories of one using git shell on Windows? I normally use GitHub (the GUI version) where local and remote repositories are listed in GUI.

What I have tried is:

$ git remote -a
$ git remote -r

I have also tried to play with history command, and browsed through some tutorials, but none of them mentions a clear cut solution. Please see if you can respond.

4
  • Seems like you'd be better off just trying to search your harddrive for .git directories. Then, look within each of those for remotes.
    – Thomas
    Jun 29, 2013 at 21:36
  • Are you looking for git remote -v ?
    – janos
    Jun 30, 2013 at 19:40
  • Janos, I actually did try that but to no avail. Jul 2, 2013 at 16:58
  • Possible duplicate of How do I search for all my git repositories on my Mac?
    – SashaZd
    Sep 8, 2016 at 18:05

2 Answers 2

2

There is no central place where a list of all your repos are stored. A git repository is nothing but a folder with some fancy content. But that means that you can find all git repos by looking for exactly that.

Do a search on all your drives for .git. If you have bare repos there, it might get a little bit more difficult. You could try looking for files that are called HEAD, though that might give you some false positives. Maybe files named config that contain the string repositoryformatversion.

0

if You are using POSIX style OS, you can run this command.

find / -name ".git"

Basically Git does not have a centeral repository that contains all the repositories. This command just search all the folders for a .git file.

Likewise on Windows or Mac, one can search for .git as well and it will list all the git repositories.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.