Search code examples
gitterminal

Is there any way to list all git repositories in terminal?


I have several git repositories on my system and I want to list them all in terminal.

What I'm looking for is something like this:

/path/to/my/git/repo/1/ REPONAME1  
/path/to/my/git/repo/2/ REPONAME2  
/path/to/my/git/repo/3/ REPONAME3

If you can come up with how to show branch name and repo's status eg. [master] c:0 u:1 d:0, that would be great.


Solution

  • To list all the git repositories you have on your system you can run the following command in a bash shell terminal (at the command line) and find them.

    find / -name .git -type d -exec dirname {} \;