Resolving git conflicts using ‘theirs’ or ‘ours’

If you want to overwrite your local copy of the conflicted file use the following commands:

git checkout –theirs path/to/the/conflicted_file.php
git add path/to/the/conflicted_file.php

 

If you want to overwrite the version in the repository with your version then

git checkout –ours path/to/the/conflicted_file.php
git add path/to/the/conflicted_file.php

 

Do a commit after making the changes above.

 

Be the first to comment

Leave a Reply

Your email address will not be published.


*


This site uses Akismet to reduce spam. Learn how your comment data is processed.