Let’s assume I merge git and there is a merge conflict.
My question is: how can I force git to always choose the newer version of code in conflict so I won’t need to resolve the conflict by hand?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It is not exactly the “newer” version, but you can tell git to always prefer the version on the current branch using
git merge branch -X ours, or to prefer the version of the branch being merged, usinggit merge branch -X theirs.From
man git-merge: