I have three repos - names changed for clarity:
SharedStuff, ProjectA and ProjectB
Both of the projects are using git-subtree to maintain a local copy of SharedStuff. They both have made local changes that I'm trying to merge up centrally, test, then merge back out to each again.
I've run this on the ProjectA repo:
git subtree split --prefix=SharedStuff -b SharedStuff_from_ProjectA --rejoin
...then pushed that to the SharedStuff repo, resolved a few simple conflicts, merged it up.
Now I've run this on the ProjectB repo:
git subtree split --prefix=platform/SharedStuff -b SharedStuff_from_Project_B --rejoin
...and again pushed that to the SharedStuff repo in a new branch. The problem occurs when I'm trying to merge those changes in.
In the current case, I switch to the SharedStuff_from_Project_B branch, then git merge master - but I immediately get all changed files listed as add/add conflicts. When I run git mergetool, each one has an error like this:
Merging:
somefile.xyz
Normal merge conflict for 'somefile.xyz':
{local}: created file
{remote}: created file
fatal: invalid path './somefile.xyz_BASE_20704.cs'
(Of course, if I try the other way around - to merge SharedStuff_from_Project_B into master - I get the same kinds of conflicts, just reversed. Still add/add).
My guess is that something might be wrong in ProjectB's history, causing the appearance of add/adds. I'm not sure how to further diagnose this, though - what can I do?
Edit: there was a previous subtree "rejoin" commit in ProjectB, but the changes weren't merged into SharedStuff at that point it seems. But, re-running git subtree split with --ignore-joins produces the same problem - lots of add/add merge conflicts, despite the history of that split subtree branch going back to when the SharedStuff was first put into ProjectB. :(
Edit: Also git merge-base between the split subtree from ProjectB and master on SharedStuff doesn't give any results. I'm not sure how this came to be or how to resolve?