2
>>>>>>> master
      .row
        - @power.next_invoice.tap do |invoice|

        %p
          = link_to t(".postings"), postings_path
<<<<<<< HEAD
    .span9{style: 'margin-top: 50px;'}
=======
    .span9
>>>>>>> master

Somehow these master and head comments/code have been added all over my code in all files. How do I remove them?

harpun
  • 4,022
  • 1
  • 36
  • 40
Rails beginner
  • 14,321
  • 35
  • 137
  • 257

3 Answers3

3

This happens when you have a merge conflict between two commits in your git repository.

You can either use a mergetool, or you can manually delete these instances (if your editor allows for search and replace, search for instances of <<<<<<< HEAD and >>>>>>> master to delete them)

In your example, I can see there you have a duplicate code here -

<<<<<<< HEAD
    .span9{style: 'margin-top: 50px;'}
=======
    .span9
>>>>>>> master

You have to decide if your wan .span9{style: 'margin-top: 50px;'} or if you want .span9 (I am assuming you have more css definitions below that). And delete the other option accordingly. ====== should also be removed.

Once you have made your decision, you should run

git status

which will show you that you have updated this particular css file and chances are you will also have a .orig copy of this file created by git. Delete the .orig file, and git add/commit to complete your merge conflict resolution.

Calvin Cheng
  • 35,640
  • 39
  • 116
  • 167
3

Those indicate areas where Git wasn't able to automatically merge your code. For example, this sections shows differences between your HEAD (top) and master (bottom) for the .span9 css style.

<<<<<<< HEAD
    .span9{style: 'margin-top: 50px;'}
=======
    .span9
>>>>>>> master

You will need to edit your files to manually merge them by choosing either your code, the merged code, or a combination of the two, and then commit your changes.

Read more about Git Branching and Merging.

doublesharp
  • 26,888
  • 6
  • 52
  • 73
2

This tells you were the difference is. You can delete the old code / change it altogheter and remove those lines. Then the conflict should be resolved