I've run into a conflict when merging a branch into my develop .
git
It couldn't resolve it automatically and I have found that I have edited the file including this:
<<<<<<< HEAD
some code
=======
some other code
>>>>>>> develop
I have been able to solve it manually by editing the file and giving it commit
, but the question remains, what is HEAD
? I assume that develop is also the develop branch where you would merge, is that correct?
Suppose my branch is named foo and I want to merge it into develop (both locally).
HEAD
is the last commit of the branch from where you mademerge
So, if you want to leave the changes from the branch you were on when you merged, you remove the lines from
develop
. If on the other hand you want to leave the changes of the branchdevelop
, you delete the lines ofHEAD
Normally HEAD is the header where your
working area
, in this case, HEAD should be the source code and DEVELOP would be the code that is in your local repository.