Re: Avery Pennarun's git-subtree?
- From
Avery Pennarun <apenwarr@gmail.com>
- Date
- Jul 21, 2010, 21:20 UTC
- Message-ID
- <AANLkTik0gqWjvHhULey89JuatjSSYsCwFegfr6E4bUKx@mail.gmail.com>
- In-Reply-To
- <AANLkTimiROxqf7KcRKTZvMvsFdd4w3jK_GLeZR8n7tdA@mail.gmail.com>
On Wed, Jul 21, 2010 at 5:09 PM, Avery Pennarun <apenwarr@gmail.com> wrote:
> All the submodules have > to get pushed to and fetched from the same repo by default. Anything > else is insane.
...and just to clarify, by far the least insane option here is to have the whole thing all under a single ref, which is currently impossible with submodules.
Show 10 quoted lines
>> What's missing from that (which would be nice) is the ability to check >> out a subdirectory from another repository. That could (I think) be >> done by just adding a normal "tree" entry, and then specifying that >> that tree can be found in git://... instead of the main tree. > > Actually that's already easy with submodules (and git-subtree makes it > easy too, though slightly different). Just fetch the commit from the > other repo, and do: > > git checkout FETCH_HEAD -- subdirname
Sorry, that's not right. You can use this instead for roughly the effect you want:
git read-tree --prefix subdirname FETCH_HEAD: && git checkout subdirname
Have fun,
Avery