On Thu, Jul 12, 2012 at 7:47 AM, Konstantin Khomoutov
<flatw...@users.sourceforge.net> wrote:
> On Thu, 12 Jul 2012 18:36:48 +0400
> Serge Matveenko <se...@matveenko.ru> wrote:
>> > In essence, checkout is the equivalent of what some other systems
>> > call "revert", and you have to get used to treating it with respect
>> > (as with any git command).
>> IMHO, it looks more like "switch" usually.
> I wonder what SCM system you have in mind saying this.
> Mercurial and Fossil use "revert" to achieve what's being discussed.
> And I know one SCM which uses the "switch" subcommand--that's
> Subversion, and it uses `svn switch` for changing branches under the
> local checkout.

git checkout foo.txt
git checkout master

The first one works like 'svn revert'; the second one works like 'svn
switch'.  Hence, checkout works like switch "usually" (for certain
values of "usually", dependent on your usage patterns).

I haven't looked at Git's innards, but to me those look like two
completely different commands that happen to be spelled exactly the
same.  Not a good idea, generally.  It doesn't help that one usage is
careful to not overwrite any of your modified files, and the other
usage is specifically intended to overwrite your modified files.


Gehm's Corollary to Clark's Law: Any technology distinguishable from
magic is insufficiently advanced.

You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
For more options, visit this group at 

Reply via email to