Subject: Re: Call Me Gitless

From: "Peter Valdemar Mørch (Lists)" <[email-masked]>
Date: Tue, 19 Aug 2008 09:53:13 +0200

Tarmigan tarmigan+git-at-gmail.com |Lists| wrote:
> One confusing part of the porcelain may be the way that git's revert
> is different from other systems' revert.  What would people think
> about something like this somewhere in git-revert(1)?
> 
> +DISCUSSION
> +----------
> +If you are more familiar with another SCM, 'git revert' may not do what you
> +expect.  Specifically, if you want to throw away all changes in your working
> +directory, you should read the man page for 'git reset', particulary the
> +'--hard' option.  If you want to extract specific files as they were in a
> +previous commit, you should read the man page for 'git checkout -- <filename>'.
> +

Here, here! That is *exactly* what I was thinking when I started reading 
this thread: "Hey, the "git diff" stuff was easy enough, it was the 
reverting (and friends) that caused me trouble!"

Also, in the same area, I've now understood that to undo a "git add" - 
to remove a change from the index and making it show up as a difference 
between the working tree and the index - one can use "git reset" 
(without --hard). Would've been helpful to me to have a sentense or 
paragraph about that in git-add.txt, or even in git-reset.txt. (I guess 
it is there in some form  in git-reset.txt, but not clearly. The "Undo 
add" example talks about a dirty index and pull) I missed the simple 
relationship between git-add and git-reset for a long time.

We've covered this recently in the " Considering teaching plumbing to 
users harmful" thread, but to me, the newbie, the sheer number of 
different commands was also quite bewildering.

Peter
-- 
Peter Valdemar Mørch
http://www.morch.com