Copy a Bitbucket Repository from one account to another bitbucket account

my friend have a repository on Bitbucket and I want to copy that repository (for future reference so that if he delete that repository i would still have one copy) to my bitbucket account.
I tried bare-cloning,mirror push and etc… but 🙁

may be I’m missing some set of commands

  • git rejected push non-fast-forward
  • How to set up auto-deploy to AppEngine when pushing to Git Repository
  • Bitbucket + XCode 4.2 + Git
  • Git pull fatal: Out of memory, malloc failed
  • SSL error between jenkins(java) and Bitbucket Plugin
  • BitBucket+Jenkins: Trigger build only when specific branch is changed
  • PS: repository type is git (not hg)

  • What are all these hidden ('._' prefixed) files that are in my git repo?
  • Clone TFS-GIT repository to GIT repository (Linux) by using GIT commands
  • Is there an advantage to using --no-metadata in git svn clone?
  • How to use git from emacs
  • Create a git diff of a file from SourceTree
  • bundle install leads to git clone error. Not sure what this response means
  • 2 Solutions collect form web for “Copy a Bitbucket Repository from one account to another bitbucket account”

    Recently, I had to do this for multiple repositories. I found a better way than cloning the repo locally and pushing it to another remote(on Bitbucket).

    Bitbucket provides import repository feature. It can be found under Repositories > Import Repository

    Bitbucket - Import Repo

    Just provide https url of the repo and access credentials, and bitbucket will do the rest for you.

    I know this is an old question but this method is easier and saves a lot of time. Hope this helps others in future.

    If you have access to that repository, then simply cloning it to your local machine is all you need to do to get a full copy of it. For example:

    git clone git@bitbucket.org:username/repository.git
    

    Now, if you want to store a copy of it online, you can just create a new repository on Bitbucket where you push to. After filling out the form there, Bitbucket will give you a quick help on how to push your data inside. Choose “I have an existing project” and the following will show up:

    Already have a Git repository on your computer? Let’s push it up to Bitbucket.

    cd /path/to/my/repo
    git remote add origin git@bitbucket.org:your_username/new-repo.git
    git push -u origin --all # pushes up the repo and its refs for the first time
    git push -u origin --tags # pushes up any tags
    

    Want to grab a repo from another site? Try our importer!

    You just need to follow those instructions closely. You will have to choose a different remote name though as with your cloning, origin is already taken:

    git remote add mycopy git@bitbucket.org:your_username/new-repo.git
    git push -u mycopy --all
    git push -u mycopy --tags
    

    Or you have to remove the origin remote first:

    git remote remove origin
    

    After pushing, your repository at Bitbucket will have the full contents, so your backup is ready.

    The other, and probably simpler, option is to simply fork your friends’ repository directly. You can do that by visiting the Bitbucket page, then click the “…” icon in the top left and choose “Fork”. This will let you create a direct copy of the repository directly on Bitbucket.

    Git Baby is a git and github fan, let's start git clone.