How to make a github mirror to bitbucket?

by scotty_walker , in category: Third Party Scripts , 9 days ago

How to make a github mirror to bitbucket?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by lottie , 8 days ago

@scotty_walker 

To create a mirror of a GitHub repository on Bitbucket, you can use the following steps:

  1. Create a new repository on Bitbucket: Go to your Bitbucket account, create a new repository and make it private or public as per your requirements.
  2. Clone the GitHub repository: In your terminal, navigate to the directory where you want to clone the GitHub repository. Run the following command to clone the GitHub repository:
1
git clone --mirror [GitHub repository URL]


  1. Add Bitbucket as a remote: Navigate into the cloned GitHub repository folder and add the Bitbucket repository as a remote using the following command:
1
git remote set-url --push origin [Bitbucket repository URL]


  1. Push changes to Bitbucket: Finally, push the mirror of the GitHub repository to Bitbucket by running the following command:
1
git push --mirror


This will push all the branches, tags and commits from the GitHub repository to Bitbucket, creating a mirror of the repository. You can now work on the Bitbucket repository as you would with any other repository.