Mirrana
Mirrana

Reputation: 1731

How do I merge two heads of a branch on Bitbucket?

I'm not terribly familiar with Mercurial, and I have no idea how I managed to do this in the first place...

https://bitbucket.org/agent154/controlsfx/branch/wizard-before_advance?head=d6dda855fd9885d3413121068e73c0fa73e3cc2e

See above link. My branch "wizard-before_advance" has multiple heads. I've been doing development using IntelliJ IDEA, but I have TortoiseHG installed. How might I fix this?

Upvotes: 1

Views: 2421

Answers (1)

Paul S
Paul S

Reputation: 7755

What you probably did was make two separate commits with revision 22ec847 as the parent. This might have occurred in two separate clones, where you committed and pushed both of them to bitbucket (expect you'd have needed a -f on the second one). It could also have occurred in a single clone because you updated to an old version and committed there.

Regardless, it's not a problem. All you have to do is merge them. The message tells you which two revisions to work with.

d6dda85
2d5a883

So we update to one of these, and merge the other.

% hg update -r 2d5a883 
% hg merge -r d6dda85
<Run checks, resolve conflicts, and basically make sure everything is good>
% hg commit -m 'Merging divergent heads'

This will leave you with a graph like this:

o---o---o---------M---
     \           /
      \-o---o---o

Where M is the merge change-set. Simple

Upvotes: 2

Related Questions