Skip to content

Instantly share code, notes, and snippets.

@mbohun
Last active June 24, 2021 10:04
Show Gist options
  • Save mbohun/834a12bd067b46112aba6707ed394c7c to your computer and use it in GitHub Desktop.
Save mbohun/834a12bd067b46112aba6707ed394c7c to your computer and use it in GitHub Desktop.
git mirror repo

Mirroring of git repo

...on my laptop:

git clone --bare https://github.com/mbohun/test_repo_for_mirror.git test_repo_for_mirror.git
cd test_repo_for_mirror.git

GitLab

git push --mirror "https://oauth2:${GITLAB_TOKEN}@gitlab.com/mbohun/test_mirror_gitlab_repo.git"

Bitbucket

git push --mirror "https://mbohun:${BITBUCKET_TOKEN}@bitbucket.org/mbohun/test_mirror_bitbucket_repo.git"

# NOTE: ALTHOUGH the URL format "https://x-token-auth:${BITBUCKET_TOKEN}@bitbucket.org/..." *DOES* work
#       for 'git clone ...'
#       it does *NOT* work for this 'git push --mirror ...' scenario
#
# git push --mirror "https://x-token-auth:${BITBUCKET_TOKEN}@bitbucket.org/mbohun/test_mirror_bitbucket_repo.git"

REFERENCES:

  • TODO
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment