Skip to content

Instantly share code, notes, and snippets.

@frogggias
Last active June 19, 2023 11:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save frogggias/7503f6a5378f24cf22548fadbe7d79fa to your computer and use it in GitHub Desktop.
Save frogggias/7503f6a5378f24cf22548fadbe7d79fa to your computer and use it in GitHub Desktop.
Mirror git repository (BB to GitHub migration)
BB_REPO_SSH_URL=
GITHUB_REPO_SSH_URL=
LOCAL_FOLDER=ghm
# Cleanup
if [ -d ${LOCAL_FOLDER} ]; then
rm -rf ${LOCAL_FOLDER}
fi
git clone --mirror ${BITBUCKET_REPO_SSH_URL} ${LOCAL_FOLDER}
# git -C ${LOCAL_FOLDER} lfs fetch --all # Uncomment for LFS support
git -C ${LOCAL_FOLDER} push --mirror ${GITHUB_REPO_SSH_URL}
# git -C ${LOCAL_FOLDER} lfs push ${GITHUB_REPO_SSH_URL} --all # Uncomment for LFS support
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment