From: Jeff King Date: Sat, 02 Mar 2013 08:04:25 GMT Subject: Re: Elegant subdirectory checkout of remote-tracking branch? Message-ID: <20130302080425.GA22861@sigill.intra.peff.net> In-Reply-To: <20130301152253.GA9312@odin.tremily.us> On Fri, Mar 01, 2013 at 10:22:53AM -0500, W. Trevor King wrote: > These fail because I can't use a remote tracking branch as a > source for the clone. It should be possible to do: > > $ git clone --reference . --single-branch --branch todo git://git.kernel.org/pub/scm/git/git.git Meta > > but that will require (I think) network access during a fetch. Yes, it will. Junio mentioned already that for him, "Meta" is really a separate repository, and I think the simplest thing is to just treat it that way (that's how I handle my personal "meta" branch). But if you really want to save the extra network round trip during a fetch, you can either: 1. Just fetch from the surrounding repository using a custom refspec, like: git init Meta cd Meta git config add remote.origin.url .. git config add remote.origin.fetch \ refs/remotes/origin/todo:refs/remotes/origin/todo git fetch git checkout todo or 2. Look into the git-new-workdir script in contrib/workdir, which lets you check out an alternate branch in a separate directory. The latter would probably be the most seamless, but it's also the most likely to have bugs. :) -Peff