Skip to content

Instantly share code, notes, and snippets.

@ariessanchezsulit
Forked from melyo/import.sh
Created May 27, 2020 13:18
Show Gist options
  • Save ariessanchezsulit/2f7866c84a3345fbac62f3ee14f61699 to your computer and use it in GitHub Desktop.
Save ariessanchezsulit/2f7866c84a3345fbac62f3ee14f61699 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