From f771f86e7f82bfd13772eaed55a5272c5c9972d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20L=C3=B8vbr=C3=B8tte=20Olsen?= Date: Tue, 9 Jan 2018 02:38:38 +0100 Subject: [PATCH] Create deltagit.sh --- bash/deltagit.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 bash/deltagit.sh diff --git a/bash/deltagit.sh b/bash/deltagit.sh new file mode 100644 index 0000000..eec7b16 --- /dev/null +++ b/bash/deltagit.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash +folders=( $1/*/ ) +repo="$2" + +declare -p folders +for folder in ${folders[@]}; do + rm -r $repo/*; + cp -r $folder/* $repo + git --work-tree=$repo --git-dir=$repo/.git add .; + git --work-tree=$repo --git-dir=$repo/.git commit -m "$folder"; +done;