git reset --merge vs git reset --keep

git, git-reset

Solution

They are different when dealing with a merge conflict, for example this will generate a conflict

git init
echo 333 > foo.txt
git add foo.txt
git commit -m 333
git checkout -b feature
echo 444 > foo.txt
git commit -am 444
git checkout master
echo 555 > foo.txt
git commit -am 555
git merge feature

Then

$ git reset --keep
fatal: Cannot do a keep reset in the middle of a merge.

$ cat foo.txt
<<<<<<< HEAD
555
=======
444
>>>>>>> feature

Versus

$ git reset --merge

$ cat foo.txt
555

Problem

I have read the documentation, however I am having a hard time understanding the difference between ``` git reset --merge ``` And ``` git reset --keep ``` Please provide a simple explaination and/or example.

Original source

Related problems