git merge only unconflicting commits

0

The idea is to merge branch B into branch A, but only merging commits which would not conflict in the process (of course this might make other commits 'become conflicting' too as they depend on a former conflicting commit but this is ok).

I think this cannot be really called merging as one skips some commits and it's more like a cherry-pick:

cherry-pick all commits in historical order, skipping those that do not work

But is there another (better) way to do this? I definitely need a list of all those skipped commits though. In case there is such way, this list needs to be provided.

If I end up writing a bash-script looping through all the commits, providing such a list of course is possible. But I don't ask you to write one, I just want to make sure there's no easier/better way before doing this!

larkey

Posted 2015-09-25T09:48:28.337

Reputation: 1 590

Did you look at this answer on Stack Overflow?

– JakeGould – 2015-09-25T17:58:26.973

If I understodd correctly this would be the solution indeed, thanks! Do you know for sure what happens when a there is a unresolvable commit? "Changes from the other tree that do not conflict with our side are reflected to the merge result." - I'm not quite sure what 'reflected to the merge result' should mean. Is it what I mean with my 'list of unmergeable commits'? – larkey – 2015-09-25T21:21:38.940

No clue. My suggestion? Just create a test repository and see what happens. – JakeGould – 2015-09-25T21:29:32.097

@JakeGould Definitely will do that, I'm just too tired to do that today - it's way too late :-) – larkey – 2015-09-25T23:10:07.917

@JakeGould I completely forgot commenting about my results, sorry! I tried this but sadly it basically would be aequivalent to copying the files from branch B into branch A and staging&commiting the results as 'merge' - ie. it merges in one commit with a huge diff :/ – larkey – 2015-10-19T15:05:34.340

No answers