How to prefer files from one branch during a merge?

As mention in the comment there are several strategies in the documentation. You can also find them here: http://git-scm.com/docs/git-merge

You are looking for either git merge -s recursive -X ours or git merge -s recursive -X theirs depending on the branch that you are on. Be careful with these as you can accidentally miss changes to your files from the other branch and these would be overwritten.

Another method, which I prefer due to more control, is to git checkout <other-branch> -- <list of files>. This way I don’t accidentally overwrite a file with the wrong changes.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)