summary refs log tree commit diff
path: root/lsgit
blob: 9b316ea1c934940a2372f2e5e0c030f3902cdaed (plain) (blame)
1
2
3
4
5
6
7
#!/usr/bin/sh
# Parse all subdirectories and list git repos encountered.
# This oneliner just naively looks for .git folders under subdirectories; it won't catch repos with changed --git-dir.

# original source (c) 2016 user1685095 CC BY-SA 3.0 <https://unix.stackexchange.com/a/333918>
# modified by Alex Starfall 2022
find '.' -type d -execdir test -e '{}/.git' ';' -printf '%P/\n' -prune | tree --fromfile .