From: Jonathan Nieder Date: Fri, 21 Jan 2011 18:37:34 GMT Subject: [PATCH] Documentation: do not treat reset --keep as a special case Message-ID: <20110121183734.GB16325@burratino> In-Reply-To: <4D39C923.20202@workspacewhiz.com> The current treatment of "git reset --keep" emphasizes how it differs from --hard (treatment of local changes) and how it breaks down into plumbing (git read-tree -m -u HEAD followed by git update-ref HEAD ). This can discourage people from using it, since it might seem to be a complex or niche option. Better to emphasize what the --keep flag is intended for --- moving the index and worktree from one commit to another, like "git checkout" would --- so the reader can make a more informed decision about the appropriate situations in which to use it. Signed-off-by: Jonathan Nieder --- Joshua Jensen wrote: > I've always wished "git reset --hard" would tell me there are > modified files and force me to type "git reset --hard --force" to > overwrite them. It is a dangerous command, and I stupidly run it > sometimes without running "git status" first. Have you tried "git reset --keep"? How does it compare to your wish? Documentation/git-reset.txt | 9 ++------- 1 files changed, 2 insertions(+), 7 deletions(-) diff --git a/Documentation/git-reset.txt b/Documentation/git-reset.txt index fd72976..927ecee 100644 --- a/Documentation/git-reset.txt +++ b/Documentation/git-reset.txt @@ -76,15 +76,10 @@ In other words, --merge does something like a 'git read-tree -u -m ', but carries forward unmerged index entries. --keep:: - Resets the index, updates files in the working tree that are - different between and HEAD, but keeps those - which are different between HEAD and the working tree (i.e. - which have local changes). + Resets index entries and updates files in the working tree that are + different between and HEAD. If a file that is different between and HEAD has local changes, reset is aborted. -+ -In other words, --keep does a 2-way merge between and HEAD followed by -'git reset --mixed '. -- If you want to undo a commit other than the latest on a branch, -- 1.7.4.rc2