Files
git_migration/migrate.sh
2022-12-23 10:58:29 +01:00

26 lines
609 B
Bash
Executable File

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