Re: Suggestion: make git checkout safer

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

 



On Wed, Jun 3, 2015 at 5:29 PM, Junio C Hamano <gitster@xxxxxxxxx> wrote:
[snip]
> [Footnote]
>
> *1* In the context of this discussion, after screwing up the change
>     in hello.c, instead of expressing the wish to recover and to
>     start from scratch in two separate commands, i.e.
>
>         rm hello.c && update-from-scm
>
>     they will learn to use a single command that is designed for
>     that purpose, i.e.
>
>         checkout-from-scm hello.c
>
>     without the "rm" step, which _is_ an artificial workaround for
>     their other SCMs that do not update from the repository unless
>     they remove the files.

Just to be clear, Subversion doesn't require you to remove the file to
restore it (I'm sure most of you know that, but just in case others
didn't).  There is a one-step way to restore the file:

    svn revert hello.c

Unfortunately, revert in the Git sense is about reverting commits, so
there's a bit of friction between Subversion and Git's terminology.
OTOH, once the team was educated how to think about it, "git checkout
<path>" has been pretty natural to use.

-John
--
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]