mirror of
https://github.com/namibia/tips.git
synced 2024-12-23 02:28:58 +00:00
Update tip and add an alternative
Update find command to exclude hidden directories. Add GNU find command
This commit is contained in:
parent
312b4a6c99
commit
55e2d4fa75
12
README.md
12
README.md
@ -698,7 +698,17 @@ git rebase --interactive HEAD~2
|
||||
|
||||
## List of git repositories in multiple directories.
|
||||
```sh
|
||||
find /path1 /path2 /path3 -regex '.*\.git' -type d -print0 | xargs -0 -I {} dirname {}
|
||||
find -E ${targetdir} \( -regex '.*/\.git
|
||||
-not -regex '.*/\..*/\.git
|
||||
\) -type d -print0 | xargs -0 -I {} dirname {}
|
||||
```
|
||||
|
||||
|
||||
__Alternatives:__
|
||||
```sh
|
||||
find ${targetdir} -regextype posix-egrep \( -regex '.*/\.git
|
||||
-not -regex '.*/\..*/\.git
|
||||
\) -type d -print0 | xargs -0 -I {} dirname {}
|
||||
```
|
||||
|
||||
<!-- Don’t remove or change the comment below – that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
|
||||
|
@ -313,5 +313,6 @@
|
||||
"tip": "git rebase --interactive HEAD~2"
|
||||
}, {
|
||||
"title": "List of git repositories in multiple directories.",
|
||||
"tip": "find /path1 /path2 /path3 -regex '.*\\.git' -type d -print0 | xargs -0 -I {} dirname {}"
|
||||
"tip": "find -E ${targetdir} \\( -regex '.*/\\.git$' -not -regex '.*/\\..*/\\.git$' \\) -type d -print0 | xargs -0 -I {} dirname {}",
|
||||
"alternatives": ["find ${targetdir} -regextype posix-egrep \\( -regex '.*/\\.git$' -not -regex '.*/\\..*/\\.git$' \\) -type d -print0 | xargs -0 -I {} dirname {}"]
|
||||
}]
|
||||
|
Loading…
Reference in New Issue
Block a user