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

Re: Site dependent repositories

From
Andrew Keller <andrew@kellerfarm.com>
Date
Aug 21, 2011, 04:21 UTC
Message-ID
<AA0C484C-FD80-4C76-9E45-4BAE51B87ED7@kellerfarm.com>
In-Reply-To
<4E507C05.2090700@sbcglobal.net>
On Aug 20, 2011, at 11:31 PM, Stewart A. Brown wrote:
Show 20 quoted lines
> I have git repositories at multiple sites.  At each site the git repository
> has site dependent sources.  Each repository is organised something
> like:
> 
> top/a/local
>      b
>      c/d/extensions
>      e
> 
> The directories top, a, b, c, d, and e have sources that need to be
> pushed or pulled between the repositories at all sites.  The directories
> 'local' and 'extensions' have sources that must be managed within sites
> but never pushed or pulled between sites.
> 
> The ignore mechanism will not suffice because the files in 'local' and
> 'extensions' must be source managed.  I have looked a bit into
> submodules, filters, and hooks.  None of these jumps out as obvious, but
> they are rich mechanisms with plenty of subtleties.
> 
> Does git have a way of letting me do this?
No.
Have you considered using a sort of configuration switch?  Include all local and extension files for every site in the repository, and devise some sort of a switch that detects which site you're in, and creates a link to the correct subfolder.
So, for example, when you first clone the repository, top/a/local would contain:

site1/ site2/ site3/

And so on.  Then, upon running a script of some sort (perhaps a make script), the site is detected (or inputted), and a symbolic link could be created to the correct folder.  At this point, top/a/local would contain:

active -> site2 site1/ site2/ site3/

where 'active' is a symbolic link pointing to the correct folder.  This symbolic link would be a candidate for a .gitignore file.
This way, any change you make in one of the site-specific folders is still tracked in the repository.  Of course, this has the disadvantage that each site has access to the files of every site.  Depending on your situation, that might be a show stopper.

HTH ~ Andrew Keller

Previous: Stewart A. BrownNext: Evan Shelhamer
Message 2 of 4 in “Site dependent repositories”
  1. Stewart A. BrownAug 21, 2011
  2. Andrew KellerAug 21, 2011
  3. Evan ShelhamerAug 21, 2011
  4. Jens LehmannAug 21, 2011

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.