Re: 'git branch' when origin branch with same name exists
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 20, 2012, 17:32 UTC
- Message-ID
- <7vr4t9x51j.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <CABURp0p6Hv8=Yg1MNb_DMRM3D2JWZtGNwn_GiOfP_x3MctrJ9A@mail.gmail.com>
Phil Hord <phil.hord@gmail.com> writes:
> Maybe you can suggest the advice verbiage which you think would have > helped this user.
Requiring starting point and failing without --force will never happen, but it could be a possible approach to issue an additional advice message under reasonably narrow conditions, namely:
- The starting point was not given explicitly;
- It would have DWIMed to "git checkout -t -b it origin/it" when creating the branch (I think you need to check configurations like branch.autosetupmerge and existence of the tracking branch remotes/origin/it); and
- advice.branchNotTrackingCorrespondingRemote is not set to false.