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

Re: [PATCH v2] Add --track option to git clone

From
Nanako Shiraishi <nanako3@lavabit.com>
Date
Dec 2, 2009, 21:07 UTC
Message-ID
<20091203060708.6117@nanako3.lavabit.com>
In-Reply-To
<20091202190807.GB30778@coredump.intra.peff.net>
Quoting Jeff King <peff@peff.net>
> I would find something like this useful for cloning git.git, where I
> explicitly fetch maint, master, next, and pu, but none of html, man, or
> todo. This makes "gitk --all" much nicer to view.
Thank you for explaining. I now can understand why it can be useful.
>   # most general case
>   git clone -f 'refs/heads/subset/*:refs/remotes/origin/*' remote.git

Because this is only about branches and no other kinds of references, I think this is an overkill.

>   git clone -f 'subset/*' remote.git
But I think this is a good idea.
Show 7 quoted lines
>   # multiple -f should add multiple refspec lines
>   git clone -f maint -f master -f next -f pu git.git
>
>   # choose your favorite branch
>   git clone -f maint -f master -f next -f pu -b next git.git
> ...
> What do you think?

I think your rule to make first branch given by -f the default for -b is a good idea. But I'm not very happy with the example with four -f. Can we probably write it like this?

  git clone -f maint,master,next,pu git.git

If it isn't a good idea to use comma, we can use colon to split the list of branch names instead.

-- 
Nanako Shiraishi
http://ivory.ap.teacup.com/nanako3/
Previous: David Soria ParraNext: Jeff King
Message 10 of 13 in “Add --track option to git clone”
  1. Add --track option to git cloneDavid Soria Parra, Dec 1, 2009
  2. 1/2 Teach clone to clone just one remote branch using --trackDavid Soria Parra, Dec 1, 2009
  3. 2/2 Documentation: Add --track option to the git clone manpageDavid Soria Parra, Dec 1, 2009
  4. Sean EstabrooksDec 2, 2009
  5. David Soria ParraDec 2, 2009
  6. Nanako ShiraishiDec 2, 2009
  7. David Soria ParraDec 2, 2009
  8. Jeff KingDec 2, 2009
  9. David Soria ParraDec 2, 2009
  10. Nanako ShiraishiDec 2, 2009
  11. Jeff KingDec 2, 2009
  12. Junio C HamanoDec 2, 2009
  13. Björn SteinbrinkDec 3, 2009

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.