Skip to content

Instantly share code, notes, and snippets.

@yavuztas
Created June 8, 2017 13:44
Show Gist options
  • Save yavuztas/ff763217b8b711bd1482c7b921ef1808 to your computer and use it in GitHub Desktop.
Save yavuztas/ff763217b8b711bd1482c7b921ef1808 to your computer and use it in GitHub Desktop.
Git cloning bare repository
git clone --mirror: to clone every references (commits, tags, branches)
git push --mirror: to push everything
That would give:
git clone --mirror https://bitbucket.org/exampleuser/repository-to-mirror.git
# Make a bare mirrored clone of the repository
cd repository-to-mirror.git
git remote set-url --push origin https://github.com/exampleuser/mirrored
# Set the push location to your mirror
git push --mirror
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment