0

I recently noticed that one of the files in my repo (local and on GitHub) contained its own diff output:

<<<<<<< HEAD
<?php echo $userimgpath ?>
=======
<?php echo $userimagepath ?>
>>>>>>> 7410f5f3b09452b925fa3cab7f3be85c8760dbc1

I didn't put this into the file myself.

In what situations can this happen?

All I have done is basic pushes/pulls/commits with GitHub as my remote. I just can't work out why this happened.

Could it be some sort of corruption? Or is it possible for a git pull to somehow merge the commit diff output into the file?

  • This is a merge conflict marker. At some point while `pull`ing you ended up with a conflict that wasn't resolved, `git add`ed, `commit`ed and `push`ed. – anthony sottile Mar 05 '18 at 00:33
  • Thank you! As you can probably see I am new to Git and this really stumped me. I was just surprised that it actually edited the file rather than just putting it in stdout. Also, the affected file was actually part of a web app that is currently being penetration tested, I thought that they'd managed to get in! Until I realised that the hex string was the commit hash I was in a bit of a panic! Post this as an answer and I'll accept. Thanks again. – rubberband876 Mar 05 '18 at 00:45
  • 1
    Possible duplicate of [Git merge left HEAD marks in my files](https://stackoverflow.com/questions/10657315/git-merge-left-head-marks-in-my-files) – phd Mar 05 '18 at 00:51
  • @phd Yeah I think it is - I didn't know what to search for to be honest, I couldn't find anything. – rubberband876 Mar 05 '18 at 01:26

0 Answers0