To find many git repository directories on your local system, we use the find command:
find ~ -type d -name .git
Sample result:
~/foo/.git
~/bar/baz/.git
~/some/other/directory/.git
We use these find command options:
To learn more about find, search the net for: unix man page find
To chop off the .git repository from the directory path, we use the xargs and dirname command:
find ~ -type d -name .git | xargs -n 1 dirname
Sample result:
~/foo
~/bar/baz
~/some/other/directory
To learn more about dirname, search the net for: unix man page dirname
To learn more about xargs, search the net for: unix man page xargs