git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] add --remote option to git-clone.

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Feb 5, 2007, 18:43 UTC
Message-ID
<Pine.LNX.4.64.0702051014040.8424@woody.linux-foundation.org>
In-Reply-To
<7vmz3smqpp.fsf@assigned-by-dhcp.cox.net>
On Mon, 5 Feb 2007, Junio C Hamano wrote:
Show 8 quoted lines
> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> >
> > 	git clone git://.../git.git#html
> >
> > to mean "just fetch the branch html, and check it out".
> 
> Except that I do not particularly think the URL fragment
> notation is such a "cool" syntax.
I think the cogito '#'<branch> syntax is braindead.

Much better to use native git syntax, which is to just list the branch separately. Why? Not only is it the way we do things for pull and friends, it's also what allows us to specify *multiple* branches.

So I would personally welcome a "clone just a particular branch", but in that case I'd like it to be able to say more than one too..

(In general, even if I clone _everything_, I'd also like to perhaps set the default 'master' branch to track something else than what I'm cloning from. In fact, I think I'd generally prefer cloning everything, but sometimes I'd like to say "I'm going to track the upstreams branch xyzzy rather than their default branch").

I realize that the
	git clone <repo> [<dir>]

means that we can't have the same syntax as "git pull" (which doesn't take the <dir> part), but that doesn't make the "#branch" syntax any better.

So I much prefer the
	git clone [--default branch] [--branch x]* <repo> [<dir>
kind of syntax.
			Linus
Previous: Junio C HamanoNext: Michael S. Tsirkin
Message 17 of 20 in “add --remote option to git-clone.”
  1. add --remote option to git-clone.Michael S. Tsirkin, Feb 1, 2007
  2. J. Bruce FieldsFeb 1, 2007
  3. Shawn O. PearceFeb 1, 2007
  4. Michael S. TsirkinFeb 1, 2007
  5. Yann DirsonFeb 1, 2007
  6. Johannes SchindelinFeb 1, 2007
  7. Shawn O. PearceFeb 1, 2007
  8. Michael S. TsirkinFeb 1, 2007
  9. Johannes SchindelinFeb 1, 2007
  10. Junio C HamanoFeb 2, 2007
  11. Johannes SchindelinFeb 2, 2007
  12. Junio C HamanoFeb 3, 2007
  13. Jakub NarebskiFeb 3, 2007
  14. Junio C HamanoFeb 3, 2007
  15. Johannes SchindelinFeb 5, 2007
  16. Junio C HamanoFeb 5, 2007
  17. Linus TorvaldsFeb 5, 2007
  18. Michael S. TsirkinFeb 5, 2007
  19. Shawn O. PearceFeb 5, 2007
  20. Michael S. TsirkinFeb 5, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.