Jump to content

The source branch can't have multiple heads


tom.peters

Recommended Posts

Good Day!

 

I have gotten into a situation where I am unable to replicate a branch to my central repository due to error: The source branch can't have multiple heads.

 

It's particularly sticky because this branch has been merged into another branch whose work I do not want to use.

 

Branch A (this is the one I cannot push to the central rep) was merged into Branch B. Branch B was merged into Branch C.

 

Now I have work in Branch C which was done by other developers which I cannot afford to lose. I am not able to delete changesets from Branch A so as to rebase it from the central server and redo all my work, therein.

 

I know this is as clear as mud, so let me know what other info would help.

 

Thanks,

Tom

Link to comment
Share on other sites

Hi,

 

This is an example of two heads unifying in one head : http://plasticscm.com/releases/4.1/manuals-html/en/userguide_archivos/image026.png

Can you review if the branch explorer data filter is large enough, and check all the branch looking for a different header?

 

If you are not able to find multiple headers, can you send us the result of this command (changing branch name by yours):

cm find changesets where branch='/main' --format={changesetid}@{parent}

And another question, which is your Plastic backend? Is the problematic branch replicated from a different repository?

 

Regards,

Carlos

Link to comment
Share on other sites

  • 1 year later...

Hello All,

 

I have the same issue. I want to clone my repository to another one in order to make some tests on this one. I tried to use the synch replication tab but when I push all ongoing changes (my source repository have just a unique branch "main"), PSCM5 says "replication failed...The source branch can't have multiple heads...".
I ran the command described above and I get the list of changesettid/parent...but how to identify the multiple heads since I have 4232 results ? Of course, I can give to the support team the command result converted txt file if necessary.

So I am stuck to make a  "clean" copy of my repository. Any suggestion ?

 

Regards,

 

Hlx

Link to comment
Share on other sites

  • 2 years later...

Hello Jeff,

those changesets that are causing the "multiple heads" issue is because the git repository is having lost references, I can solve the problem by creating a single empty changeset unifying them all but notice that if you push the repository back to Git the Plastic changeset will be translated into a Git commit with the references unified as well, this should't be a problem but I let you know it as it's a secondary effect. Both Plastic and Git commits will be empty.

If you want to proceed I'll need you to provide me with the following files:

cm find merge where srcbranch='br:/main' and dstbranch='br:/main' --format={srcchangeset} --nototal > merges.txt

cm find changesets where branch='/main' --format={changesetid}@{parent} --nototal > csets.txt

I also need to know the repository name, I'll generate a file you'll need to commit to solve the issue.

Link to comment
Share on other sites

  • 2 months later...

I am having a similar issue with a combination of GluOn and Cloud Edition users.  I suspect it's because the devs started branching off secondary main branches created by GluOn.  I've tried to merge them all back into main, but when trying to push get the error.

The sync process was unable to replicate the following branch:

Branch: /main
Operation: Push
Source repository: Beta@local
 

Error description:
The source branch can't have multiple heads

Current Branch Explorer

PlasticMulitpleHeads2.jpg.a801487e06d763100805ba5203995852.jpg

 

PlasticMulitpleHeads.thumb.jpg.1f2b85a0b07e35b9879f43d36671da11.jpg

Link to comment
Share on other sites

Hi Brian,

This is a pretty common scenario when you are working distributed and working on /Main, and in parallel your cloud coworkers are also using /main.

Is not really a problem if you learn how it works and how to resolve the scenario. Here you have more info: https://www.plasticscm.com/documentation/distributed/plastic-scm-version-control-distributed-guide.shtml#Howreplicationworks

The problem was indeed the cherrypick, you need a merge operation in order to unify heads. Once you just have one you are free to push back.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...