Skip to content

Instantly share code, notes, and snippets.

@arthurio
Created November 23, 2021 20:09
Show Gist options
  • Save arthurio/96dac5167d7f58f93d945f602af5be69 to your computer and use it in GitHub Desktop.
Save arthurio/96dac5167d7f58f93d945f602af5be69 to your computer and use it in GitHub Desktop.
#!/bin/zsh
set -euxo pipefail
for service in messaging-py
do
(
cd $service
git clean -fd .
mkdir $service
mv .* * $service || true
mv $service/.git .
git add .
git commit -a -S -m "Moving old project into its own subdirectory" --no-verify
cd ../notivize
git remote add $service ../$service
git fetch $service
git co -b merge-$service
git merge -S --allow-unrelated-histories $service/main
git push origin merge-$service
cd ../$service
git reset --soft HEAD~1
git reset .
git checkout .
mv $service/.* . || true
rm -rf $service
)
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment