From 8cb1a370f9f99976ccacfa69cb95367879f072c4 Mon Sep 17 00:00:00 2001 From: Starfall Date: Thu, 15 Dec 2022 10:54:30 -0600 Subject: lsgit: list git repos under the current directory --- lsgit | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100755 lsgit diff --git a/lsgit b/lsgit new file mode 100755 index 0000000..9b316ea --- /dev/null +++ b/lsgit @@ -0,0 +1,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 +# modified by Alex Starfall 2022 +find '.' -type d -execdir test -e '{}/.git' ';' -printf '%P/\n' -prune | tree --fromfile . -- cgit