diff options
author | B Stack <bgstack15@gmail.com> | 2018-06-05 22:09:29 -0400 |
---|---|---|
committer | B Stack <bgstack15@gmail.com> | 2018-06-05 22:09:29 -0400 |
commit | 36a153aebd8ead555f32d6ca7fd42ab8be07ea2b (patch) | |
tree | f487881d9e779d3375938b680350de42e58fa751 /migrate.sh | |
parent | initial retrieval from github (diff) | |
download | former-gists-36a153aebd8ead555f32d6ca7fd42ab8be07ea2b.tar.gz former-gists-36a153aebd8ead555f32d6ca7fd42ab8be07ea2b.tar.bz2 former-gists-36a153aebd8ead555f32d6ca7fd42ab8be07ea2b.zip |
add raw notes about project migration
Diffstat (limited to 'migrate.sh')
-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 + |