Jump to content

Can't sync with git due to message "branch has more than one head"


FredM

Recommended Posts

Hi,

 

Using the linux GTK client version 5.4.16.680 I have successfully sync'd my plastic repo with a remote git repo.

 

And today I got the following message : 

 

Receiving references... |
- branchA: Local changes (36318ad)
- branchB: Up to date (8232360)
Receiving references... \The branch(es) /main has more than one head. Please, merge it to be able to continue synchronizing
 
I have looked for corrective actions without success. Does this issue requires action on the plastic repo or the git repo ?
 
Thanks
 
Fred
 
Link to comment
Share on other sites

Ok problem solved. What happened is that I had performed a sync after I had committed work on the plastic repo and a colleague had committed work on the git repo.

At some point the plastic repo history ended up with two changesets "ends" (or "heads") :

 

My plastic commits : 29->30->35

commits obtained from git : 29->33->34

 

Note : in the branch explorer, the commits obtained from git, appear on some sort of second line (the branch grey path gets wider to contain the git changesets).

 

The fix : I selected the last commit from git (the last changeset on the "second line" under the main changesets), right mouse button + select "Merge from this changeset...", completed the operation. And could perform the sync afterwards.

 

Useful command to diagnose the issue :

 

  cm find "changeset where branch='main'" --format="{changesetid}@{parent}"

 

If you encounter the issue you'll probably notice in the output two distincts changesets chains.

 

Note on Linux : circling the request with double quotes is *required*.

 

Fred

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...