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

Re: Quick way to clone exactly one branch

From
Jeff King <peff@peff.net>
Date
May 28, 2009, 20:32 UTC
Message-ID
<20090528203200.GA14576@coredump.intra.peff.net>
In-Reply-To
<m3ljohas9x.fsf@localhost.localdomain>
On Thu, May 28, 2009 at 01:26:05PM -0700, Jakub Narebski wrote:
Show 8 quoted lines
> > No, AFAIK there isn't a simpler way to do it. But it is something people
> > have asked about before, so I think it would be a nice addition.
> > 
> > You can't even use "git remote" because it doesn't allow you to tweak
> > the refspecs you add. [...]
> 
> It doesn't? Strange, I thought that is what '-t <branch>' option
> for "git remote add" for ;-))))

Oh, indeed. For some reason I thought that was about setting up tracking for branches. So yes, Avery would be much better off in his example with

    git remote add -t master origin git://whatever
But it would still be even nicer to have "clone -t master".
-Peff
Previous: Jakub Narebski
Message 4 of 4 in “Quick way to clone exactly one branch”
  1. Avery PennarunMay 20, 2009
  2. Jeff KingMay 28, 2009
  3. Jakub NarebskiMay 28, 2009
  4. Jeff KingMay 28, 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.