Skip to content

Instantly share code, notes, and snippets.

@melyo
Created May 27, 2020 13:08
Show Gist options
  • Save melyo/f4ae12bb26f69c26f86faa1ee6253b7f to your computer and use it in GitHub Desktop.
Save melyo/f4ae12bb26f69c26f86faa1ee6253b7f to your computer and use it in GitHub Desktop.
#!/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