diff options
-rwxr-xr-x | migrate.sh | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/migrate.sh b/migrate.sh new file mode 100755 index 0000000..6c0a41a --- /dev/null +++ b/migrate.sh @@ -0,0 +1,22 @@ +#!/bin/sh +# https://stackoverflow.com/questions/20359936/import-an-existing-git-project-into-gitlab/30483494#30483494 + +username="bgstack15" +repo="${1}" + +func() { + git clone --mirror "https://github.com/${username}/${repo}" "./${repo}" + pushd "${repo}" + git remote add gitlab "https://gitlab.com/${username}/${repo}.git" + git push gitlab --mirror + popd +} + +time func ; + +#Now if you have a locally cloned repository that you want to keep using with the new remote, just run the following commands* there: +# +#git remote remove origin +#git remote add origin "http://gitlab.example.com/${username}/${repo}.git" +#git fetch --all + |