Re: Git reset -p on working tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Nov 23, 2010 at 4:28 PM, knittl <knittl89@xxxxxxxxxxxxxx> wrote:
> `git reset` seldomly affects the working tree, unless using `--hard`,
> `--merge` or `--keep`, and those switches are potentially dangerous if
> you are not aware of the implications to your worktree and index.
>
> without options reset undoes a previous add, i.e. remove changes from
> the index, but not the working tree.
>
> git reset manpage mentions git-checkout:

Agreed. What I'm saying is most manuals/guides out there tips user to
use 'git reset --hard' to discard changes in the working directory and
restore the pristine copy of files. 'reset' then becomes synonymous to
discard, and it kind of is but for a different reason. Because other
commands offer -p for selective operations, one might try to discard
selectively, and end up using 'git reset -p --hard', which obviously
isn't going to work.

Knowing the users intention in such cases, I was suggesting the error
message could hint the right command (just like git commit hints user
to use git-add when one does 'git commit' with a dirty working tree).

But that's just me.

-- 
Jeenu
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]