Incorporating both changes when resolving git merge confilct -
let's have 2 development branches (master , feature) ,  both branches added code same file. when trying merge feature master run single confict: 
++<<<<<<< head + //some code added in master branch ++======= + //some code added in feature branch ++>>>>>>> feature   if want accept head (master) , abandon feature run: 
git checkout --ours path/to/file   if want accept feature (master) , abandon head run: 
git checkout --theirs path/to/file   how can accept both changes result of conflict resolution simple union of code?
//some code added in master branch //some code added in feature branch      
you have edit file manually, , remove conflict markers (if that, result "union" want).
git not because conflict resolution semantic problem program cannot offer general solution.
though if or on large scale, doubtless write script (doing in automated way break code though).
Comments
Post a Comment