I recently had to make a couple of changes which required rebuilding the repository using hg convert. Unfortunately, this means the bitbucket repo is now inconsistent with the copy I have locally. I don't want to just "blow away" the repo as it exists on bitbucket, because that gets rid of all the other customizations / issue tracking etc. that are associated with the project there.
Is it possible to completely wipe the repository from Bitbucket's view of things and push everything from my local (fixed) repo there?
Click the Admin tab, and select Transfer Repository from the left side of the menu. Enter the username of the user or team account you want to transfer your repository to. Bitbucket will send a transfer request to that particular user or team account.
Clone a Bitbucket repository Read more about Git cloning. Click + in the global sidebar on the left, and under Get to work select Clone this repository. Select HTTPS from the menu in the upper-right (unless you've already set up your SSH keys). Copy the clone command.
You can strip the changesets from the Bitbucket repository. Go to
https://bitbucket.org/<user>/<repo>/admin/strip
and you'll get a chance to enter a revision to strip. The revision number you enter plus all its descendants will be deleted from Bitbucket. So if you enter 0
, then all changesets will be removed from the remote repository.
This brings you back to the clean slate you had when you first created the repository on Bitbucket and you can now push your code again.
The settings for the project remain intact (issues, wiki) and any existing forks also remain. People who've forked your project will have to do the same strip operation — you have to coordinate this with them and this is the reason why editing history is hard. Bitbucket warns you about this by telling you the number of works right on the strip admin page.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With