Question

I am git newbie. When I hope to reset hard to discard all local modification, git return merge conflict

HEAD is now at 3291a25 will create merge conflict 1

my operation:

  1. about half a month I commit as below

    git commit -am "will create merge conflict 1"
    
  2. today I hope to reset --hard to this ref

    yaoyangyong@ubuntulucky:~/repos01$ git reset --hard HEAD
    HEAD is now at 3291a25 will create merge confict 1
    
  3. The output confuse me. In fact, it is just my old comment.

Was it helpful?

Solution

git is simply telling you the result of the reset.

HEAD(your current position) is now at 3291a25(the commit you wanted to reset to) "will create merge confict 1"(the message of the commit).

You should pass a commit which you want to reset to rather than just say HEAD. Also, if you want to abort a half completed merge, use git merge --abort (or git reset --merge in older versions of git).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top