David Ball
David Ball

Reputation: 563

Create a branch from a tag

I've got into a bit of a mess with my project in Mercurial. I'm not an expert at all, and would appreciate some help. There's 2 of us working on our project simultaneously, but haven't ever needed to branch it, we've worked from the same repository, using bitbucket as the repository.

The situation we've got ourselves into (not sure how) is that we've got 2 branches, both called "default", and a tag called "tip". Viewing these in bitbucket, both of the branches are out of date, and cloning either of these will get a version of the project that's a year old. But browsing the tag (called "tip" - not sure how it got that name) shows the latest changes.

So my partner has made some changes, and I can see them if I browse "tip" on bitbucket. But for some reason I can't see them when I pull changes to my local project. It just says "no changes found".

I'm not sure how I've got into this mess, but what I think would be best is if the tag could be changed into the default branch, and the second unnecessary branch (also called "default") should be closed.

Upvotes: 0

Views: 106

Answers (1)

nullptr
nullptr

Reputation: 11058

tip is an automatic tag that just marks the tip (most recent commit) of the repository.

If I understood you correctly, you have two heads of default branch, and you are stuck at one of them. In your local repository, run hg heads. You should see two heads.

You can just hg up to the correct head and work with it.

Well, you can "close" one of the heads by moving it to a separate branch: update to the undesired head specifying its local revision number hg up -r <rev>, rename and close the branch: hg branch undesired, hg commit --close-branch -m "Closing branch". Then you can perform hg update default to switch to the right default branch.

Upvotes: 1

Related Questions