Re: [PATCH 0/3] teach git-checkout -B WAS builtin/checkout: DWIM with -f -b

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

 



Hi,

2010/6/21 Tay Ray Chuan <rctay89@xxxxxxxxx>:
> On Tue, Jun 22, 2010 at 1:19 AM, Tay Ray Chuan <rctay89@xxxxxxxxx> wrote:
>> Right now, the -f/--force in git-checkout doesn't carry over to -b
>> operations - ie. you can't do git checkout -b branch on an existing
>> branch.
>>
>> This patch allows you to do this with the -B option, so that one can do
>>
>>  git checkout -B branch ref
>>
>> which is equivalent to
>>
>>  git branch -f branch ref && git checkout branch

If I need to do that, I would do: git checkout branch && git reset --hard ref.

Another way to do it is: git branch -D branch && git checkout -b branch ref.

So, we have enough porcelain commands to do it.  I would recommend a
second thought to see if your refinement is really necessary.  I would
agree so if those procedures are needed very often.

> Erick, does this series change how --orphan should be used?

If you be careful It won't make any change.  I will comment that on
the series if needed.

Thanks very much for asking.

Kind regards
--
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]