Subject: Re: Considering teaching plumbing to users harmful

From: Theodore Tso <[email-masked]>
Date: Thu, 17 Jul 2008 10:26:54 -0400

On Thu, Jul 17, 2008 at 03:35:22PM +0200, Peter Valdemar Mørch wrote:
> E.g. something I seem to succeed with sometimes, but not consistently is  
> the equivalent of "svn revert -R .". "git help reset"? Yup: "git reset  
> --hard HEAD ." When I run into merge conflicts, I'll probably look at  
> such a doc again, but other than that I'll probably use man pages most.

You find quick alias to be a useful replacement for "svn revert -R
<file>" (aka "hg revert <file>" and "bg revert <file>"):

git config --global alias.revert-file "checkout HEAD --"

Once you run this command, you can now do "git revert-file <file>"
which I personally find very handy.  Sometimes I only want to revert
one file, and not all of the files in the working directory, which is
what "git reset --hard" will do.

(Note that "git revert" does something else useful, but which is not
the same as "hg revert", "bk revert" and "svn revert". Oh well, nobody
ever said DSCM's had to be consistent.)

						- Ted