tom.peters Posted May 20, 2013 Report Share Posted May 20, 2013 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 More sharing options...
calbzam Posted May 20, 2013 Report Share Posted May 20, 2013 Hi, You need to unify the branch heads. Once the heads are unified (using the merge) the branch can be replicated. This a post explaining how to fix the same issue: http://www.plasticscm.net/index.php?/topic/985-error-replicating-main/?hl=%2Bsource+%2Bbranch+%2Bcan%26%2339%3Bt+%2Bhave+%2Bmultiple+%2Bheads Regards, Carlos Link to comment Share on other sites More sharing options...
tom.peters Posted May 20, 2013 Author Report Share Posted May 20, 2013 Hi Carlos - Sorry, but that post isn't helping me... Tom Link to comment Share on other sites More sharing options...
calbzam Posted May 22, 2013 Report Share Posted May 22, 2013 Hi, But are you able to see the two headers in branch A? Once you unify the headers in branch A you will be able to replicate. Regards, Carlos Link to comment Share on other sites More sharing options...
tom.peters Posted May 22, 2013 Author Report Share Posted May 22, 2013 Hey Carlos - ...and therein lies the problem. How do I identify the headers? Looking at the link provided, I am not able to figure this out. Link to comment Share on other sites More sharing options...
calbzam Posted May 23, 2013 Report Share Posted May 23, 2013 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 More sharing options...
tom.peters Posted May 30, 2013 Author Report Share Posted May 30, 2013 Thanks to Carlos' help, the bad changeset was identified and I was able to delete it... HUZZAH! All is well! Thanks, again! Link to comment Share on other sites More sharing options...
calbzam Posted May 31, 2013 Report Share Posted May 31, 2013 Cool!! Link to comment Share on other sites More sharing options...
hlx Posted September 11, 2014 Report Share Posted September 11, 2014 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 More sharing options...
hlx Posted September 11, 2014 Report Share Posted September 11, 2014 Please, any idea, suggestion ? Hlx Link to comment Share on other sites More sharing options...
calbzam Posted September 16, 2014 Report Share Posted September 16, 2014 Hi, Please send me a txt with the result of the above command and I will try to figure out the multiple heads: calba at codicesoftware dot com Regards, Carlos Link to comment Share on other sites More sharing options...
jeffpk Posted March 2, 2017 Report Share Posted March 2, 2017 I'm having this same problem after importing a GIT project with mulitple roots. Instructions on how to fix it would be most welcome Link to comment Share on other sites More sharing options...
calbzam Posted March 3, 2017 Report Share Posted March 3, 2017 Hi, You need to unify (merge) the different heads of the branch so at the end the branch as a unique head. Are you able to easily identify the heads from the "branch explorer" view? Regards, Carlos Link to comment Share on other sites More sharing options...
jeffpk Posted March 3, 2017 Report Share Posted March 3, 2017 This is what the end of my branch explorer looks like. I assume i have to combine these into one branch? What command should I use? Thanks Link to comment Share on other sites More sharing options...
manu Posted March 6, 2017 Report Share Posted March 6, 2017 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 More sharing options...
Brian Judy Posted June 3, 2017 Report Share Posted June 3, 2017 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 Link to comment Share on other sites More sharing options...
Brian Judy Posted June 4, 2017 Report Share Posted June 4, 2017 My problem seems to have been due to attempting a cherry pick from a main-subbranch and seemed to have not closed the head. When removing check-ins and the cherry pick the issue seems to have been resolved. Link to comment Share on other sites More sharing options...
manu Posted June 5, 2017 Report Share Posted June 5, 2017 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 More sharing options...
Brian Judy Posted June 7, 2017 Report Share Posted June 7, 2017 It seems resolved. Thanks for checking. Link to comment Share on other sites More sharing options...
manu Posted June 8, 2017 Report Share Posted June 8, 2017 Perfect! Don't hesitate to contact us if you have any questions. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.