Re: 'git branch' when origin branch with same name exists

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

 



hi,

On 12-06-19 02:31 PM, Junio C Hamano wrote:
But I do not think "git branch" can sensibly and
correctly make that decision for the user---at least I do not sense
any of the people who is in this thread has clear idea on what to
base that decision on, and "the same name appears in an existing
remote" is not it.  "The same name appears, and the new branch is
not set to integrate with it" may be closer, but that may forbid
valid use cases too much.

My originally intended point was that it should be prevented in the case where 'git branch' is given no additional arguments (ie: implicitly creating the branch from HEAD). Obviously it should be possible to create a 'gtk-3-4' branch that is based on the origin one. In any case, I should have made that more clear.

So to restate the feature request more clearly: "git branch X" with no explicitly specified start-point should prevent the branch "X" from being created when a branch with the same name already exists on a remote (perhaps only considering 'origin').

When stated in this more explicit way, it becomes clear that a --force option would not even be required; you could just say:

  git branch gtk-3-4 HEAD

to make it clear that this was your intention.

Nobody making a casual mistake would type that in full.


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