What relation do two branches have after a git merge (on Xcode)?
-
09-06-2021 - |
Domanda
Say I had a branch A. I then create branch B, make a bunch of changes and commit. I then merge B into A, but choose to keep the A-version for some parts of some files. (I'm using Xcode to do these, and am not sure about the git command line equivalents)
What is the relation between A and B at this point, does git know that I didn't merge some of the changes in B? Later on, can I somehow make it merge the changes that I chose to ignore during the first merge of B into A?
(I think what I want is something similar to git cherry-pick, but "cherry-pick"ing part of one misguidedly large commit)
Soluzione
What is the relation between A and B at this point, does git know that I didn't merge some of the changes in B?
No, Git only know a certain commit of B has been merged to A.
How you choose to merge its content is your business. Git only records the merge.
(And this doesn't depend on XCode)
Later on, can I somehow make it merge the changes that I chose to ignore during the first merge of B into A?
Not directly. If the partially merged files from A
haven't changed at the time of the second merge, those files won't be merged again.
At this point, a diff between files from A
and B
, followed by a patch on B
could be a solution.