Re: Can't checkout branch

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

 



Chris Torek <chris.torek@xxxxxxxxx> writes:

>  2. Treat this as `git checkout -b deploy origin/deploy`
>     or `git checkout -t origin/deploy`, i.e., create the
>     branch `deploy` from `origin/deploy`.
>
> If *both* of these alternatives work, pre-2.23 Git *assumes* you
> meant alternative number 1.  In 2.23 or later, `git checkout`
> tells you that this is ambiguous and makes you pick which one you
> want.
>
> To work around this in all versions of Git, you can just be
> more explicit.  For instance:
>
>     git checkout deploy --
>
> forces Git to treat it as a branch name.

I actually think "git checkout -t -b deploy origin/deploy" is a
better way to be explicit to avoid confusion.  You do not create a
branch every few seconds anyway---it is more important to instill in
user's head what really does go on by encouraging them to give these
command line arguments explicitly, instead of teaching new people to
rely on "git guesses most of the time in your favor so here is the
lazy command line"---that will prevent true understanding and if it
left unremedied long enough, will result in a confused user who is
no longer a newbie.

Having said that, yes "git checkout deploy --" is a way to still
rely on git guessing most of the time in your favor to stay lazy,
and it should work, but there may be unseen other factors to break
the DWIM, just like Larry didn't think of an existing file deploy
in the working tree to be interfering.

Thanks.



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

  Powered by Linux