# git reset --merge misdocumented?

2 messages from 2009-01-29 to 2009-01-30. Participants: Johannes Schindelin, Thomas Rast.
Thread: https://gitlist.dev/t/17424

## Johannes Schindelin, 2009-01-29 01:17

Subject: git reset --merge misdocumented?
Message-ID: <alpine.DEB.1.00.0901290210540.3586@pacific.mpi-cbg.de>
URL: https://gitlist.dev/e/alpine.DEB.1.00.0901290210540.3586%40pacific.mpi-cbg.de

```
Hi,

from the man page I thought that --merge would be just another way to say 
"git read-tree -u -m".

In particular, the man page says _nothing_ about resetting HEAD to 
something else.

Maybe somebody with l33ter dox skillz than me would like to fix that.

Ciao,
Dscho

```

## Thomas Rast, 2009-01-30 23:20

Subject: Re: git reset --merge misdocumented?
Message-ID: <200901310020.23851.trast@student.ethz.ch>
URL: https://gitlist.dev/e/200901310020.23851.trast%40student.ethz.ch
In-Reply-To: <alpine.DEB.1.00.0901290210540.3586@pacific.mpi-cbg.de>

```
Johannes Schindelin wrote:
> from the man page I thought that --merge would be just another way to say 
> "git read-tree -u -m".

Isn't that idea from the commit message?  I can't find any mention of
read-tree in next's idea of the manpage.

> In particular, the man page says _nothing_ about resetting HEAD to 
> something else.

It says

  --merge::
          Resets the index to match the tree recorded by the named commit,
          and updates the files that are different between the named commit
          and the current commit in the working tree.

so while the exact way of "updating" is not specified, it does mention
that you can move between commits, and that it will do something with
the difference across the move.

The example further down really cleared up the idea for me:

  Undo a merge or pull inside a dirty work tree::
  +
  ------------
  $ git pull                         <1>
  Auto-merging nitfol
  Merge made by recursive.
   nitfol                |   20 +++++----
   ...
  $ git reset --merge ORIG_HEAD      <2>
  ------------

I've never used 'read-tree -u -m' except in voodoo scripting, but I'd
have done the same with 'git stash && git reset --hard ORIG_HEAD &&
git stash pop' before.  The original commit message even mentions this
equivalence.

So I'm not sure what exactly needs changing there?

-- 
Thomas Rast
trast@{inf,student}.ethz.ch

```
