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

Re: [git question] how to handle few projects with common parts?

From
Avery Pennarun <apenwarr@gmail.com>
Date
Oct 23, 2009, 16:07 UTC
Message-ID
<32541b130910230907x38d8c1f8vb504865eaf5b524@mail.gmail.com>
In-Reply-To
<368bc75e0910230201y8e4310dme6276d436c6a6ab6@mail.gmail.com>
On Fri, Oct 23, 2009 at 5:01 AM, Ivan Dimitrov <ivand58@gmail.com> wrote:
Show 6 quoted lines
> Maybe my question relates rather to configuration management, but it
> is over GIT.
> In short - I have to manage two projects with 95% same files
> (components) and all the rest are platform depended. I am trying to
> keep different platforms in different branches, but I can't figure out
> how keep the common part of the project synchronized?

Are the other files (1) *completely* different across branches, or (2) the same in each branch, but customized?

If (1), I don't think branches are the answer. You probably just want a subdir per platform and a simple config file that points at which branch to use. Or maybe use some #ifdefs, or whatever the equivalent is in your system.

If (2), perhaps what you want is three branches: a main development branch, and two customized branches that you merge (or rebase) master into. I do this sometimes when I want a "development" branch and then some specific customizations for a particular production deployment. (eg. a default config file and the "live" config file, and I want both to be version controlled separately)

Have fun,
Avery
Previous: Ivan Dimitrov
Message 2 of 2 in “[git question] how to handle few projects with common parts?”
  1. Ivan DimitrovOct 23, 2009
  2. Avery PennarunOct 23, 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.