Git merge left HEAD marks in my files

前端 未结 5 815
旧时难觅i
旧时难觅i 2020-11-22 15:26

I tried to merge a file in the command line using Git, when an error message appeared telling me the merge was aborted.

I thought that was the end of it, but then I

5条回答
  •  夕颜
    夕颜 (楼主)
    2020-11-22 16:04

    Those are conflict markers. You're still in the process of merging, but there were some parts that Git couldn't merge automatically. You'll need to hand-edit those parts to what you want them to be and then commit the results.


    For instance, in your particular case, you'd probably want to resolve it like this (note - the arrows/text on the right are just my notes, not something you'd type into the file):

    integer = 
    <<<<<<< HEAD                                  <-+ remove the bits here
        digits:[0-9]+                               |
            { return digits.join(""); }             |
    =======                                       <-+
        sign:"-"* digits:[0-9]+
            { return sign + digits.join(""); }
    >>>>>>> gh-pages                              <-- and this
    

    and thus you'd save the file as...

    integer = 
        sign:"-"* digits:[0-9]+
            { return sign + digits.join(""); }
    

提交回复
热议问题