#git #merge #conflict #bash

: One solution to solve the problem is to resolve the merge conflict by using the command line.

1. Open Git Bash
2. Navigate into the local Git repository that has the merge conflict with the command: “cd REPOSITORY-NAME”
3. Generate a list of the files affected by the merge conflict with the command “git status”.
4. Open a text editor and navigate to the file that has merge conflicts.
5. To see the beginning of the merge conflict in your file, search the file for the conflict marker “<<<<<<<”.When you open the file in your text editor, you'll see the changes from the HEAD or base branch after the line <<<<<<< HEAD. Next, you'll see =======, which divides your changes from the changes in the other branch, followed by >>>>>>> BRANCH-NAME.
6. Decide if you want to keep only your branch's changes, keep only the other branch's changes, or make a brand new change, which may incorporate changes from both branches. Delete the conflict markers <<<<<<<, =======, >>>>>>> and make the changes you want in the final merge.
7. Add your changes with the command “git add”
8. Commit your changes with git commit –m “message”
Now you can merge your branch.

OperatingSystem:

Subscribe to #git #merge #conflict #bash