git migration
This commit is contained in:
25
migrate.sh
Executable file
25
migrate.sh
Executable 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
|
||||
|
||||
Reference in New Issue
Block a user