It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Create branch from previous commit?

Simon Wimbles Jul 15, 2016

Hi all,

I'm new to this so I apologise if this seems really obvious, but I haven't found a solution so far. We are using Bitbucket along with Mercuriel and have a contractor working on a software project. He has been sending me updated revisions of the project and I have been committing them to a locally held repository and pushing them to Bitbucket. I made a mistake where I committed (and pushed) a version of the project I should not have. He made a temporary fix in this particular version which is not in subsequent versions. Now when I try to push his latest version of the project to Bitbucket I get an error saying the push would create a new head. It then suggests I pull and merge, which I don't want to do as the resultant version would contain this temporary fix. He is not available to  help as his contract has ended.

Is it possible to create a branch from the version previous to the temporary fix? Or is there a better solution I'm unaware of?


Many thanks for help!

2 answers

0 votes
Simon Wimbles Jul 17, 2016

Bump (as I posted it late on a Friday afternoon).

0 votes
Sean Farley Atlassian Team Jul 20, 2016

I'm not quite sure how the history of this repository looks, so it's a bit difficult to say what exactly you should here. But, in general, if you're trying to cherry-pick these commits, then check out the `hg graft --help` command. Of course, once you're satisfied with the result, you can `hg strip --help` the old commits away. This is the same as doing a rebase but let's you inspect the result before moving on.

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published in Bitbucket Pipelines

Building a Bitbucket Pipe as a casual coder :  #!/bin/bash source "$(dirname "$0")/" enable_debug extra_args="" if [[ "${DEBUG}" == "true" ]]; then extra_args="--verbose" fi # mandatory variables R...

3,087 views 1 20
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you