From: Jens Lehmann <Jens.Lehmann@web.de>
To: "W. Trevor King" <wking@tremily.us>
Cc: Git <git@vger.kernel.org>
Subject: Re: Git submodule for a local branch?
Date: Tue, 23 Oct 2012 22:57:57 +0200 [thread overview]
Message-ID: <508704D5.9020902@web.de> (raw)
In-Reply-To: <20121022123714.GL25563@odin.tremily.us>
Am 22.10.2012 14:37, schrieb W. Trevor King:
> I have a bunch of branches in my repo (a, b, c, …), and I'd like to
> check them out into subdirectories of another branch (index). My
> initial inclination was to use something like
>
> $ git checkout index
> $ git branch
> a
> b
> c
> * index
> $ git submodule add -b a --reference ./ ./ dir-for-a/
> $ git submodule add -b b --reference ./ ./ dir-for-b/
> $ git submodule add -b c --reference ./ ./ dir-for-c/
>
> but cloning a remote repository (vs. checking out a local branch)
> seems to be baked into the submodule implementation. Should I be
> thinking about generalizing git-submodule.sh, or am I looking under
> the wrong rock? My ideal syntax would be something like
>
> $ git submodule add -b c --local dir-for-c/
But then we'd have to be able to have two (or more) work trees using
the same git directory, which current submodule code can't.
> The motivation is that I have website that contains a bunch of
> sub-sites, and the sub-sites share content. I have per-sub-site
> branches (a, b, c) and want a master branch (index) that aggregates
> them. Perhaps this is too much to wedge into a single repository?
To me this sounds upside-down. I'd put the three sub-sites into
different repositories and the shared content into a submodule that
all three sub-sites use. At least that is how I do all my content
sharing on the websites I have done ... does that make sense?
next prev parent reply other threads:[~2012-10-23 20:58 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-22 12:37 Git submodule for a local branch? W. Trevor King
2012-10-23 13:21 ` W. Trevor King
2012-10-23 20:57 ` Jens Lehmann [this message]
2012-10-23 22:09 ` W. Trevor King
2013-01-08 15:59 ` Moving (renaming) submodules, recipe/script W. Trevor King
-- strict thread matches above, loose matches on Subject: below --
2013-01-07 0:36 W. Trevor King
2013-01-07 1:39 ` Jonathan Nieder
2013-01-07 6:59 ` Jens Lehmann
2013-01-07 7:44 ` Junio C Hamano
2013-01-07 8:18 ` Jens Lehmann
2013-01-07 16:08 ` Junio C Hamano
2013-01-07 12:08 ` W. Trevor King
2013-01-08 14:32 ` W. Trevor King
2013-01-08 17:12 ` Jens Lehmann
2013-01-08 17:48 ` W. Trevor King
2013-02-09 12:32 ` [BUG] can't switch branches with submodules W. Trevor King
2013-02-03 23:38 ` Moving (renaming) submodules, recipe/script W. Trevor King
2013-02-03 22:36 [New Feature] git-submodule-move - Easily move submodules TJ
2013-02-04 20:14 ` Jens Lehmann
2013-02-09 12:25 [BUG] can't switch branches with submodules Ramkumar Ramachandra
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=508704D5.9020902@web.de \
--to=jens.lehmann@web.de \
--cc=git@vger.kernel.org \
--cc=wking@tremily.us \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).