git migration

This commit is contained in:
2022-12-23 10:58:29 +01:00
commit 68657ba764
4 changed files with 65 additions and 0 deletions

25
migrate.sh Executable file
View File

@@ -0,0 +1,25 @@
#!/bin/bash
# Usage:
# Create the repo in Github, and then give the repo name as the argument:
# ./migrate-git-repos.sh repo-name
#(Optional) Mass migration
#To do this in mass, I put each repo name on its own line in a file named repo-list, and looped through them with:
# for repo in $(cat repo-list); do ./migrate-git-repos.sh $repo; done
# Echo commands as they're run, and expand variables
set -o xtrace
REPO="$1"
git clone --mirror http://192.168.2.3:3000/$REPO.git old_repo
cd old_repo
git remote set-url origin http://debianVM.local:3000/$REPO.git
git push --mirror
cd ..
rm -rf old_repo