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

Need help deciding between subtree and submodule

From
RDRobert Dailey <rcdailey.lists@gmail.com>
Date
Mar 17, 2015, 22:14 UTC
Message-ID
<CAHd499DN1FUzxGYBtUmZ_gKcCvXWJdR6-6XYXsN6BRn0LVO84g@mail.gmail.com>
At my workplace, the team is using Atlassian Stash + git

We have a "Core" library that is our common code between various projects. To avoid a single monolithic repository and to allow our apps and tools to be modularized into their own repos, I have considered moving Core to a subtree or submodule.

I tried subtree and this is definitely far more transparent and simple to the team (simplicity is very important), however I notice it has problems with unnecessary conflicts when you do not do `git subtree push` for each `git subtree pull`. This is unnecessary overhead and complicates the log graph which I don't like.

Submodule functionally works but it is complicated. We make heavy use of pull requests for code reviews (they are required due to company policy). Instead of a pull request being atomic and containing any app changes + accompanying Core changes, we now need to create two pull requests and manage them in proper order. Things also become more difficult when branching. All around it just feels like submodule would interfere and add more administration overhead on a day to day basis, affecting productivity.

Is there a third option here I'm missing? If only that issue with subtree could be addressed (the conflicts), it would be perfect enough for us I think. I have done all the stackoverflow reading and research I can manage at this point. I would really love some feedback from the actual git community on what would be a practical solution and structure here from a company perspective.

Thanks in advance!
Next: Chris Packham
Message 1 of 4 in “Need help deciding between subtree and submodule”
  1. Robert DaileyMar 17, 2015
  2. Chris PackhamMar 18, 2015
  3. Doug KellyMar 18, 2015
  4. Robert DaileyMar 19, 2015

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.