0

I need to update current branch, but do not want to destroy , therefore I need a partial merge. I do not like cherry-pick and rebase is no option..

How to merge the difference from B-A into C ?

The question is not about how to merge in general. I would like to know.. is it possible to only merge the difference from A to B into C. If you do some big changes in C like deleting files, modifying a lot of files. Then you do not want to resolve all possible merge-conflicts again, which are caused from A. My only focus is on the commits between A and B.

I was thinking about sth. like: git merge A..B C

If it is not possible please tell me so, cause I did not find an answer yet.

                       - o D
                     /   |
   B o    o C     B o    o C
     |    |         |    |
     |    o         |    o
     |   /          |   /
   A o -          A o -
     |              |
john s.
  • 476
  • 9
  • 21
  • 1
    Isn't that just a normal merge? Checkout to C and merge B, then you can go back to B an keep working, right? I guess I'm missing something – Blasco Jan 27 '18 at 09:42
  • 2
    What's wrong with `git checkout C; git merge B`? – axiac Jan 27 '18 at 09:43
  • Expect in C are many changes on A.. so there are many merge-conflicts I do not want to resolve.. – john s. Jan 27 '18 at 09:43
  • 3
    If there are merge conflicts, then you will need to resolve them before you merge. – Oliver Charlesworth Jan 27 '18 at 09:48
  • 5
    @johns. From that comment, it sounds a *lot* like you already knew the answer before asking and just didn't like that answer. –  Jan 27 '18 at 10:08
  • Possible duplicate of [How to resolve merge conflicts in Git?](https://stackoverflow.com/questions/161813/how-to-resolve-merge-conflicts-in-git) – eis Jan 27 '18 at 10:47
  • `so there are many merge-conflicts I do not want to resolve.` (by @johns.) There is not really a way around that – LinFelix Jan 27 '18 at 12:44
  • e.g. assume you delete some files in C. If you merge B into C the previous work would be undone. I thought there would be an nice way of doing that like `git merge A^..B C` – john s. Jan 27 '18 at 18:22
  • 1
    No, there isn't, because the change you're merging is that the file is deleted. There is no such thing as a partial merge, either you merge, or you don't. – Lasse V. Karlsen Jan 27 '18 at 18:59

0 Answers0