[prev in list] [next in list] [prev in thread] [next in thread] 

List:       git
Subject:    Re: [PATCH v2] status: display "doing what" information in git status
From:       Matthieu Moy <Matthieu.Moy () grenoble-inp ! fr>
Date:       2011-05-06 19:15:26
Message-ID: vpqei4bvdwx.fsf () bauges ! imag ! fr
[Download RAW message or body]

Pierre Habouzit <madcoder@debian.org> writes:

> On Fri, May 06, 2011 at 08:40:04PM +0200, Matthieu Moy wrote:
>> Pierre Habouzit <madcoder@debian.org> writes:
>> 
>> > +	const char * const merge_advice =
>> > +		_("use \"git reset --hard\" to abort, or resolve conflicts and commit");
>> 
>> I think that should be "git reset --merge" (which preserves files not
>> touched by the merge, and makes sure "git merge; git reset" doesn't
>> permanently loose data).
>
> Wow, I didn't know about that one, so /maybe/ the hint isn't that
> useless after all :)

Actually, there's very few reason to run "git reset --hard" these days,
and we should really consider it as a very dangerous command that should
not be advertized to beginners. There's almost always a safer
alternative:

* You want to cancel a merge => git reset --merge
  (doesn't touch files not impacted by merges)

* You want to change the commit your HEAD points to => git reset --keep
  (in case you have local changes, they won't be overridden)

* You want to discard local changes => git stash
  (you may not think these changes are important, but you may be wrong)

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic