Re: why is git destructive by default? (i suggest it not be!)
- From
Brandon Casey <casey@nrlssc.navy.mil>
- Date
- Jun 26, 2008, 15:13 UTC
- Message-ID
- <K8mYvOxbzHDUUveNqGY1qxKxQCRRn4fCJly5l1F_bU9bM2LdvpAD1g@cipher.nrlssc.navy.mil>
- In-Reply-To
- <20080625022610.GB20361@mit.edu>
Theodore Tso wrote:
Show 8 quoted lines
> On Tue, Jun 24, 2008 at 04:07:57PM -0700, Junio C Hamano wrote: >>> Instead, I've just learned to be careful and my use of git reset >>> --hard is mainly for historical reasons. >> This makes it sound as if avoiding "reset --hard" is a good thing, but I >> do not understand why. > > Well, it was Brandon Casey who was asserting that git reset --hard was > evil, which I generally don't agree with.
I definitely don't think 'reset --hard' is evil. I _do_ think it is somewhat of an advanced command. It should be used where it is appropriate. I think it is a misuse of the command if it is used in place of checkout, which I got the impression might be the case.
You described resetting an integration branch, Junio does a similar thing with pu and these are both valid uses. This is what I was talking about when I said that usually when I use reset I don't care about the state of the branch I am resetting. I also agree there are many other valid uses for 'git reset --hard'.
-brandon