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?
Asked
Active
Viewed 203 times
1 Answers
1
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 ofupdated.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 inupdatedwith versions of those files that do not conflict because they are identical.Get back on
outdatedand do the merge.Get back on
updatedand copy the conflicting files back into the worktree.
matt
- 515,959
- 87
- 875
- 1,141