Misc-small-projects/bash/deltagit.sh
Daniel Løvbrøtte Olsen f771f86e7f
Create deltagit.sh
2018-01-09 02:38:38 +01:00

12 lines
262 B
Bash

#!/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;