Thread (6 messages) 6 messages, 2 authors, 2016-06-15

Re: [PATCH] git-clone: Add option --branch to override initial branch

From: Tor Arne Vestbø <hidden>
Date: 2016-06-15 22:46:19

Johannes Schindelin wrote:
On Mon, 2 Mar 2009, Tor Arne Vestbø wrote:
quoted
The options --branch and -b allow the user to override the initial 
branch created and checked out by git-clone. Normally this is the active 
branch of the remote repository, which is also the fallback if the 
selected branch is not found.
I do not think that falling back if the selected branch is not found is a 
wise choice.
Ah, was not sure what the proper response would be. I'll resubmit with a
die() instead.
Besides, the common way to check out something different than the remote's 
HEAD is like this:

	$ git clone -n $URL
	$ cd $DIR
	$ git checkout -t origin/$BRANCH
Yepp, plus removing the original branch:

 $ git branch -D $ORIGINAL_ACTIVE_BRANCH # typically master
I am undecided if that is good enough, or your patch is needed.
The idea was to be able to tell someone "hey, if you want to hack on
some feature for next, do the following:"

 $ git clone git://git.kernel.org/pub/scm/git/git.git -b next

Maybe next is not such a good example, since it does not diverge that
much from master and pu, but imagine a repository with a master, plus
other branches that over time diverge from master (where you would
typically use git-new-workdir to have them in a separate working tree).

In that situation it would be nice to be able to tell someone, hey, if
you want to work on this odd branch which is not master, just do -b.

Tor Arne
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help