I'm curious where I've scattered my git repositories across my mac. I'm trying to figure out how I could do a search to find them all so I can organize my life a bit. How can I do this?
Find is your friend. a .git folder will exist in each of your repositories so finding the location of them will give you all your repos.
find /Users/username -name ".git" -print
Use find
:
find ~ -name .git
This searches for the .git
directory that is created in all (non-bare) Git repositories.
Choice of a suitable file to search for to find bare repositories is left as an exercise for the reader.
In shell:
find $HOME -type d -name ".git"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With