fix merge conflicts in git code example

Example 1: git find merge conflicts

git diff --name-only --diff-filter=U

Example 2: what is merge conflict in git

A merge conflict is an event that occurs when Git is unable to
automatically resolve differences in code between two commits.
When all the changes in the code occur on different lines or in
different files, Git will successfully merge commits without
your help

Example 3: Automatic merge failed; fix conflicts and then commit the result.

# Step 1:  
# Navigate into the local Git repository that has the merge conflict.

cd REPOSITORY-NAME

# Step 2: 
# Generate a list of the files affected by the merge conflict. 
# In this example, the file styleguide.md has a merge conflict.

git status

> # On branch branch-b
> # You have unmerged paths.
> #   (fix conflicts and run "git commit")
> #
> # Unmerged paths:
> #   (use "git add ..." to mark resolution)
> #
> # both modified:      styleguide.md
> #
> no changes added to commit (use "git add" and/or "git commit -a")

# Step 3: 
# Open your favorite text editor, such as Atom, and 
# navigate to the file that has merge conflicts.
# 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. 
# In this example, one person wrote "open an issue" in the base or HEAD 
# branch and another person wrote "ask your question in IRC" in the 
# compare branch or branch-a.

If you have questions, please
<<<<<<< HEAD
open an issue
=======
ask your question in IRC.
>>>>>>> branch-a

# Step 4:
# 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. 

# In this example, both changes are incorporated into the final merge:

If you have questions, please open an issue or 
ask in our IRC channel if it's more urgent.

# Step 5:
# Add or stage your changes.

git add .

# Step 6:
# Commit your changes with a comment.

git commit -m "Resolved merge conflict by incorporating both suggestions."

Example 4: how to show code conflicts in git

$ cat merge.txt<<<<<<< HEADthis is some content to mess withcontent to append=======totally different content to merge later>>>>>>> new_branch_to_merge_later

Example 5: how to show code conflicts in git

$ git statusOn branch masterYou have unmerged paths.(fix conflicts and run "git commit")(use "git merge --abort" to abort the merge)Unmerged paths:(use "git add <file>..." to mark resolution)both modified:   merge.txt