Skip to content

Commit 312b4a6

Browse files
committed
Add list command
1 parent 67f84e1 commit 312b4a6

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

README.md

Lines changed: 6 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,10 @@ git log --first-parent
695696
git rebase --interactive HEAD~2
696697
```
697698

699+
## List of git repositories in multiple directories.
700+
```sh
701+
find /path1 /path2 /path3 -regex '.*\.git' -type d -print0 | xargs -0 -I {} dirname {}
702+
```
703+
698704
<!-- Don’t remove or change the comment below – that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
699705
<!-- @doxie.inject end -->

tips.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,4 +311,7 @@
311311
}, {
312312
"title": "Merge previous two commits into one.",
313313
"tip": "git rebase --interactive HEAD~2"
314+
}, {
315+
"title": "List of git repositories in multiple directories.",
316+
"tip": "find /path1 /path2 /path3 -regex '.*\\.git' -type d -print0 | xargs -0 -I {} dirname {}"
314317
}]

0 commit comments

Comments
 (0)