Skip to content

Commit 2681a7c

Browse files
committed
Merge pull request git-tips#50 from arrrggghhh/listOfRepos
Add list command
2 parents 9582450 + ecc8eb2 commit 2681a7c

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@
102102
* [Extract file from another branch.](https://github.com/git-tips/tips#extract-file-from-another-branch)
103103
* [List only the root and merge commits.](https://github.com/git-tips/tips#list-only-the-root-and-merge-commits)
104104
* [Merge previous two commits into one.](https://github.com/git-tips/tips#merge-previous-two-commits-into-one)
105+
* [List of git repositories in multiple directories.](https://github.com/git-tips/tips#list-of-git-repositories-in-multiple-directories)
105106

106107
<!-- Don’t remove or change the comment below – that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
107108
<!-- @doxie.inject end toc -->
@@ -695,5 +696,20 @@ git log --first-parent
695696
git rebase --interactive HEAD~2
696697
```
697698

699+
## List of git repositories in multiple directories.
700+
```sh
701+
find -E /path1 /path2 /path3 \( -regex '.*/\.git
702+
-not -regex '.*/\..*/\.git
703+
\) -type d -print0 | xargs -0 -I {} dirname {}
704+
```
705+
706+
707+
__Alternatives:__
708+
```sh
709+
find /path1 /path2 /path3 -regextype posix-egrep \( -regex '.*/\.git
710+
-not -regex '.*/\..*/\.git
711+
\) -type d -print0 | xargs -0 -I {} dirname {}
712+
```
713+
698714
<!-- Don’t remove or change the comment below – that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
699715
<!-- @doxie.inject end -->

0 commit comments

Comments
 (0)