Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
+9 votes
6 views
in DevOps and Agile by (19.4k points)
edited by

How do I resolve merge conflicts in Git?

1 Answer

+9 votes
by (27.5k points)
edited by

Merge conflicts in git can be resolved by following these few steps:

  • The first step would be to understand why the conflict occurred in the first place. It could be because of a same line edit on the same file, could be because of deleting some file, also could be because of files with same file names. You can check everything by using ‘git status’
  • Then we need to mark and clean up the conflict, open the files using mergetool, git marks the conflicted area like this "<<<<< HEAD" and " >>>>> [other/branch/name]".
  • At last we will perform commit again and then merge the current branch with the master branch.

Please go through the tutorial link given below to understand git completely.

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...