]> 91.132.146.200 Git - klimbim.git/commitdiff
git example to search in multiple repos at once
authorBanana <mail@bananas-playground.net>
Sat, 21 Mar 2020 17:35:20 +0000 (18:35 +0100)
committerBanana <mail@bananas-playground.net>
Sat, 21 Mar 2020 17:35:20 +0000 (18:35 +0100)
git/git-search-multiple-repos.sh [new file with mode: 0644]

diff --git a/git/git-search-multiple-repos.sh b/git/git-search-multiple-repos.sh
new file mode 100644 (file)
index 0000000..03081a7
--- /dev/null
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+# copywrite by Johannes 'Banana' Keßler 2020
+
+# this example show how to search multiple repos in the current
+# directory. Use this to create your own command and search.
+
+for d in */; do
+  git -C "$d" --no-pager rev-list --all | xargs git -C "$d" --no-pager grep -l SEARCHTERM >> search.log;
+done;
\ No newline at end of file