Misc-small-projects/bash/deltagit.sh

12 lines
262 B
Bash
Raw Normal View History

2018-01-09 02:38:38 +01:00
#!/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;