Re: [PATCH/RFC] builtin-checkout: suggest creating local branch when appropriate to do so
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Oct 5, 2009, 21:17 UTC
- Message-ID
- <alpine.DEB.1.00.0910052314580.4985@pacific.mpi-cbg.de>
- In-Reply-To
- <1254775583-49452-1-git-send-email-jaysoffian@gmail.com>
Hi,
On Mon, 5 Oct 2009, Jay Soffian wrote:
Show 19 quoted lines
> A user who has just cloned a remote repository and wishes to then work on a > branch other than master may not realize they first need to create the local > branch. e.g.: > > $ git clone git://git.kernel.org/pub/scm/git/git.git > $ cd git > $ git checkout next > error: pathspec 'next' did not match any file(s) known to git. > > This commit teaches git to make a suggestion to the user: > > $ git clone git://git.kernel.org/pub/scm/git/git.git > $ cd git > $ git checkout next > error: pathspec 'next' did not match any file(s) known to git. > To create a local branch from the same named remote branch, use > git checkout -b next origin/next > > Motivated by http://article.gmane.org/gmane.comp.version-control.git/129528
Actually, we should really think long and hard why we should not automatically check out the local branch "next" in that case. I mean, really long and hard, and making sure to take user-friendliness into account at least as much as simplicity of implementation.
Ciao, Dscho