Created
May 27, 2020 13:08
-
-
Save melyo/f4ae12bb26f69c26f86faa1ee6253b7f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
# PREREQ: add ssh keys to both git cloud host | |
OLD_ORG=mely0 | |
OLD_REPONAME=test001 | |
OLD_REPO=bitbucket.org | |
echo "Old repo=git@${OLD_REPO}:${OLD_ORG}/${OLD_REPONAME}" | |
NEW_ORG=melyo | |
NEW_REPONAME=test005 | |
NEW_REPO=gitlab.com | |
echo "New repo=git@${NEW_REPO}:${NEW_ORG}/${NEW_REPONAME}" | |
git clone --bare git@${OLD_REPO}:${OLD_ORG}/${OLD_REPONAME}.git | |
cd ${OLD_REPONAME}.git | |
git lfs fetch --all | |
git config lfs.https://${NEW_REPO}/${NEW_ORG}/${NEW_REPONAME}.git/info/lfs.locksverify true | |
git lfs push --all git@${NEW_REPO}:${NEW_ORG}/${NEW_REPONAME}.git | |
git push --all git@${NEW_REPO}:${NEW_ORG}/${NEW_REPONAME}.git |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment