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

Re: Project- vs. Package-Level Branching in Git

From
Andreas Ericsson <ae@op5.se>
Date
Jan 27, 2011, 20:09 UTC
Message-ID
<4D41D103.4080502@op5.se>
In-Reply-To
<14F4737F-E8E4-4E4E-A625-16CA63CF9EFF@shaggyfrog.com>
On 01/27/2011 08:38 PM, Thomas Hauk wrote:
Show 31 quoted lines
> Back when I worked at a large games company, we used Perforce, and
> our repo structure looked a little something like this:
> 
> /branches /alpha /beta /mainline /packages /external /foolib /1.0 
> /1.1 /2.0 /internal /barlib /dev /1.0 /2.0 /bazlib /2.34 /2.35 /qux 
> /dev
> 
> At the package level, we would split up packages/libraries into two
> groups based on if they were developed at the company or not
> (external/internal), and inside each one, we might have multiple
> versions. In the example above, the repo is for the "qux" game, which
> uses an internal "bazlib" library developed by another group, and the
> "barlib" library which was developed for use on "qux" and may be used
> simultaneously on other projects.
> 
> Project-level branches took mainline as a base and branched into the
> /branches directory. Package-level branches would usually take the
> "dev" version (which represented the current development version,
> akin to "master" in Git) as a base and branch into the same parent
> directory but with an actual version name.
> 
> I've successfully used this repo structure with several other
> projects over the years at other companies (who were mostly using
> Subversion). Now I'm trying to get into the Git swing of things, but
> it seems to be that Git only offers project-level branching, and
> doesn't allow for the kind of package-level branching I'm describing
> here.
> 
> Am I incorrect or is there a way to accomplish with Git what I was
> doing before with P4 and SVN?
> 

You're correct. There's no way to accomplish what you wish to do inside git. I'd suggest submodules, but that still doesn't get you the per-directory branching inside a git repository, even though it does make it rather trivial to change versions at will.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

Considering the successes of the wars on alcohol, poverty, drugs and
terror, I think we should give some serious thought to declaring war
on peace.
Previous: Thomas HaukNext: Ævar Arnfjörð Bjarmason
Message 2 of 16 in “Project- vs. Package-Level Branching in Git”
  1. Thomas HaukJan 27, 2011
  2. Andreas EricssonJan 27, 2011
  3. Ævar Arnfjörð BjarmasonJan 27, 2011
  4. Thomas HaukJan 27, 2011
  5. Jay SoffianJan 28, 2011
  6. Jakub NarebskiJan 28, 2011
  7. Enrico WeigeltJan 29, 2011
  8. David AguilarJan 29, 2011
  9. Enrico WeigeltJan 30, 2011
  10. Jakub NarebskiJan 31, 2011
  11. Enrico WeigeltJan 31, 2011
  12. Marc BranchaudJan 28, 2011
  13. in-gitvger@baka.orgJan 28, 2011
  14. Eugene SajineJan 28, 2011
  15. Enrico WeigeltJan 29, 2011
  16. Enrico WeigeltJan 29, 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.