+11 votes
1 view
in Devops and Agile by (20k points)
edited by

How do I resolve merge conflicts in Git?

1 Answer

+11 votes
by (28.4k 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.

Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...