Re: 'git branch' when origin branch with same name exists
- From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
- Date
- Jun 20, 2012, 17:51 UTC
- Message-ID
- <vpqa9zxan3a.fsf@bauges.imag.fr>
- In-Reply-To
- <7vr4t9x51j.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
Show 12 quoted lines
> 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.
I like that. Stg like
$ git branch next Creating local branch next starting from <sha1>. If you meant to checkout a new branch 'next' to track remote branch 'next' from 'origin', run these commands now: git branch -d next; git checkout next
-- Matthieu Moy http://www-verimag.imag.fr/~moy/