From c7c34932592e7e49eb8d6d50d65d0c0797aefea3 Mon Sep 17 00:00:00 2001 From: Ismo Vuorinen Date: Mon, 30 Oct 2023 14:24:08 +0200 Subject: [PATCH] feat: git-update-dirs, update subdir repos --- local/bin/git-update-dirs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 local/bin/git-update-dirs diff --git a/local/bin/git-update-dirs b/local/bin/git-update-dirs new file mode 100755 index 0000000..d3a5f05 --- /dev/null +++ b/local/bin/git-update-dirs @@ -0,0 +1,14 @@ +#!/usr/bin/env bash +# +# Updates subfolders git projects. +# +# Actions taken: pull with rebase, autostashes own changes +# and prunes branches no longer in the remote. +# +# Copyright (c) 2023 Ismo Vuorinen. All Rights Reserved. +# License: MIT + +for f in */; do (cd "$f" && echo "-> $f" && git pull --rebase --autostash --prune); done + +echo "Done." +echo ""