Skip to content

Instantly share code, notes, and snippets.

@T1T4N
Last active February 7, 2024 10:37
Show Gist options
  • Save T1T4N/03340d9c1a5385c1382dc076b5345160 to your computer and use it in GitHub Desktop.
Save T1T4N/03340d9c1a5385c1382dc076b5345160 to your computer and use it in GitHub Desktop.
Mirroring a git repository to Bitbucket
git clone --bare https://github.com/project/repo.git
cd repo
git push --mirror ssh://git@bitbucket/lib/new-repo.git
# if this results in the following error:
# You are attempting to update refs that are reserved for Bitbucket's pull request functionality. Bitbucket manages these refs automatically, and they may not be updated by users.
# remote: Rejected refs:
# remote: refs/pull-requests/1/from
#
# then use the following commands
git push ssh://git@bitbucket/lib/new-repo.git
git push --tags ssh://git@bitbucket/lib/new-repo.git
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment