i have two branches, one more updated than other one and I want to merge into the outdated one the updated but only the commits that don't cause conflicts. When I do the merge and try to checkout the unstaged files it says 'warning: path "my file" is unmerged' and i want to merge anyways, how can i do that?
Let's call your branches outdated
and updated
. I'm assuming you want to do the merge of updated
into outdated
without merging the conflicted files but somehow keeping your updated
branch's version of them. So:
Get on outdated
. Attempt the merge of updated
.
Git emits a list of conflicting files.
Write down their pathnames.
Abort the merge.
Get back on updated
. Copy the conflicting files to a place of greater safety (outside this worktree).
Checkout, from outdated
, the conflicting files, thus overwriting the conflicting files in updated
with versions of those files that do not conflict because they are identical.
Get back on outdated
and do the merge.
Get back on updated
and copy the conflicting files back into the worktree.