Based on this question I came up with this command to find out all .git
repositories on my machine.
find / -type d -name .git 2>&-
And it works relatively fast. Though I hear my CPU's fan a little, which shows that my machine does some work.
Now I want to be able to loop over the results and run git commands on each of them. For example, I want to get their status to see what should be managed.
I tried:
find / -type d -name .git 2>&- | xargs git status
But it didn't work:
fatal: not a git repository (or any of the parent directories): .git
I also tried:
find / -type d -name .git 2>&- | xargs dirname | xargs git status
Again, the same error.
What command should I use?