gh-notify-move/migrate.sh
Yann Esposito (Yogsototh) f14e64b82d
initial commit
2018-06-06 16:19:08 +02:00

27 lines
533 B
Bash
Executable file

#!/usr/bin/env zsh
newURL="$1"
tmpDir="tmp-repo-$$"
mkdir $tmpDir
cd $tmpDir
for repoURL in $(< ../repos-urls); do
newRepoURL="$newURL/$(echo $repoURL|sed 's#.*/##')"
echo $repoURL ' => ' $newRepoURL
> README.md << END
This repository has moved to $newRepoURL
migrated with https://gitlab.esy.fun/yogsototh/gh-notify-move
END
git init
git remote add origin $repoURL
git add README.md
git commit -m "Moved with gh-notify-move"
git push -uf origin master
rm -rf .git
done
cd ..
rm -rf $tmpDir