Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git ignore remaining merge conflicts

Tags:

git

git-merge

After I solved all merge conflicts I care about, I want to merge regardless of all remaining conflicts. I'd like git to keep the files from the branch I want to merge into (--ours strategy).

How can I do that?

like image 407
danijar Avatar asked Dec 25 '12 17:12

danijar


People also ask

How do I ignore a merge conflict in git?

The simplest way, if you have unmerged paths, use git merge --abort to abort the merge. This way your code will look the same as it was before trying to merge with some other branch...

How do I stop unfinished merge?

You can use the git reset --merge command. You can also use the git merge --abort command. As always, make sure you have no uncommitted changes before you start a merge.


1 Answers

It is a bad idea to commit binaries, but i'll explain to you how to make what you need

you are in branch special and you have done a merge, you have fixed some conflicts and you want to let others like in branch master so you should make this

git reset --mixed (reset the index but not the working tree; changes remain localy but not used in the commit)
git add {files those you have fixed the conflict}
git commit
git reset --hard
git merge --strategy=recursive -X theirs origin/master  
{merge twice and you take files as in branch origin/master}

you use master if changes are in your local repository, if changes are in distant repository, you use origin/master

like image 103
elhadi dp ıpɐɥןǝ Avatar answered Oct 02 '22 14:10

elhadi dp ıpɐɥןǝ