Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I search for all my git repositories on my Mac? [closed]

Tags:

git

macos

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?

like image 382
Josiah Avatar asked Nov 30 '10 22:11

Josiah


3 Answers

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
like image 65
Daniel Rucci Avatar answered Oct 27 '22 10:10

Daniel Rucci


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.

like image 25
Greg Hewgill Avatar answered Oct 27 '22 11:10

Greg Hewgill


In shell:

find $HOME -type d -name ".git"
like image 36
Wesley Rice Avatar answered Oct 27 '22 11:10

Wesley Rice