21 comments

  • mmastrac212 days ago
    Every time I end up using repos with submodules, I&#x27;m stuck in the submodule unwedging dance at some point. It&#x27;s just not worth it. Either it&#x27;s stuck with changes that accidentally snuck into the subtree (rm -rf and submodule init&#x2F;update), the commit is bad and git can&#x27;t update to it somehow (maybe it&#x27;s not a tag and can&#x27;t be fetched? usually gets fixed with rm -rf and submodule init&#x2F;update), or maybe it&#x27;s just when I switched branches and it&#x27;s left in a dirty state because... reasons.<p>Git is elegant is so many ways, but submodules are the broken, ugly stepchild of the beauty that git is.<p>I suspect it&#x27;s not the idea of submodules, but the terrible, terrible command interface to them and how badly they work with the rest of the system.
    • crossroadsguy212 days ago
      Having used few “lesser” VCSes I am not so sure I’d call Git elegant. It just became famous and defacto VCS of the Internet - a lot of that credit must go to Github (which also was and is used a lot by comps and teams). Something like Markdown — one day everyone and their kittens were just using it which is not necessarily not a compliment.<p>I had created 2-3 char git submodule related aliases. Git submodule exists because a better alternative isn’t available (which gives us same behaviour or close to it).
      • nine_k211 days ago
        As a side note: git won because <i>at the time</i> all other VCSes were either functionally worse (lice RCS or Subversion), or were good but required a paid license (like Perforce or BitKeeper), or were too slow to for larger projects like Linux (Mercurial).<p>More advanced things were created since then, like Fossil or Pijul. But the network effects make git predominant now.
        • cassianoleal211 days ago
          &gt; But the network effects make git predominant now.<p>That and the fact that it&#x27;s... well, it&#x27;s a good system - if perhaps not with the best UX.<p>It works well for pretty much everyone who cares to learn the basics, and then you can evolve from there with more practice. Which is probably true of any system.
          • nine_k211 days ago
            Indeed, git is pretty good internally, despite the clunkiness of the CLI.<p>But, say, Mercurial is also pretty good in many aspects. It used to be rather popular, but its popularity is waning, and not because of some kind of technical inferiority.
            • cassianoleal211 days ago
              According to the post I originally responded to:<p>&gt; or were too slow to for larger projects like Linux (Mercurial).<p>So it seems like there were technical reasons for Git vs. Mercurial. I don&#x27;t really know and having never used Mercurial, I couldn&#x27;t comment on how good it is or how it compares with Git.<p>From what I read around, it&#x27;s mostly the UX that&#x27;s marginally better on the Mercurial side. This is the point where the network effect certainly has weight. If one offering is not better enough than the one people are used to, there is no compelling reason to learn something anew and move all existing projects over.<p>When there is great technical reason, people will move though and the network effect will start moving across. See the previous systems that were popular before Git: Subversion, CVS, ClearCase, etc. Those have mostly been phased out completely, except maybe for older projects that have them ingrained into their processes and technology.
        • Vilian211 days ago
          Perforce wasn&#x27;t good either, yes bitkeeper was better but hit still managed to make things better, at least for the linux kernel development
        • petepete211 days ago
          Git won because GitHub.
          • nine_k211 days ago
            I&#x27;ve been on a number of projects which used git without GitHub. But of course GitHub like &quot;the default&quot; repository of open-source projects has done a lot to make git the default VCS.
          • hiatus211 days ago
            Have you forgotten sourceforge?
            • rileymat2211 days ago
              Sourceforge was terrible by the time Github was ascending.
            • petepete210 days ago
              No, unfortunately. It was terrible by comparison.<p>There&#x27;s no wonder GitHub drew people in. It&#x27;s interface and ease of building a community around a repo made of so much more accessible than anything else around at the time.
          • guappa211 days ago
            github was a paid service only in the beginning. Which means few were using it.
  • jimmydoe212 days ago
    I don&#x27;t get the opposition to submodule. imho it&#x27;s fine, there are limited options with it, so limited chance it may go wrong.<p>some suggested package manager, which imho is another layer of dependency, e.g. in Python, it always takes me some extra seconds to figure out which package manager I&#x27;m supposed to use, and it&#x27;s constantly evolving.<p>end of day it&#x27;s up to which one you are most familiar with.
    • sshine211 days ago
      Submodules are the feature you discover someone pulled in when things don&#x27;t work, and after a bit of digging, you realize it&#x27;s because the submodule wasn&#x27;t initialized, and it didn&#x27;t say so anywhere.<p>I suspect the opposition to submodules comes from the poor (manual) integration.<p>As someone suggested in another thread, they ought to auto-recurse by default.<p>But I don&#x27;t think that&#x27;s going to happen, either.<p>Maybe something like direnv where it tells you about the unloaded submodule once you enter the repository. Except that won&#x27;t work for IDEs.
    • dig1211 days ago
      My impression of this opposition (and hate) is that people don&#x27;t read the docs and expect submodules to bend to their vision of how submodules should work. Because of that, we have multiple similar but not the same &quot;submodule&quot; implementations: git-submodule, git-subtree, git-subrepo...
    • nobodywillobsrv211 days ago
      I think one problem is that submodules are kind of over-kill in situations where what you really want is to have separate repos for various reasons but one way of pulling them all in at once. You could make a script with the origins etc but then you put than in a repo and then ...<p>I use them in my personal projects and have a sprawling mass of crazy. It &quot;works&quot; but it&#x27;s a pain and I have scripts to recursively crawl through and basically do &#x27;git pull&#x27; everywhere or &#x27;git push&#x27;.<p>So if you end up using submodules when you don&#x27;t really care about <i>versioning</i> the sub-repos, I think you end up feeling a bit of an idiot like me. But it&#x27;s a pain to reverse.
    • sureIy211 days ago
      Same here. I used it and set it up once and had no issues personally, but only after documenting how to deal with it exactly.<p>It&#x27;s just a rare feature so people don&#x27;t know how to deal with it, so they just hate it. Once you figure out the 5 commands you will need you&#x27;re golden.
  • gorgoiler211 days ago
    Not only are they “a pain” but I see git submodules as the technical equivalent of a “Big Tent” political party trying to fit mutiple divergent factions into a single entity.<p>At some point someone in a submodule repo is going to go rogue and make something incompatible with the bigger picture. Psychologically, they’ve merged to their trunk so as far as they are concerned their change is complete. Task done, “mission accomplished”. Yet until it’s also in the parent repo’s trunk, it might as well still be on a branch.<p>In a monorepo, the rogue coder would instead still be on a branch. They’re done when their branch works <i>and</i> their change is merged (er, ff’d!) onto the one true main, not before.<p>None of this applies to FOSS projects. Those <i>are</i> Big Tents where political negotiations are constantly required to keep various democratically equal projects aligned.<p>In the corporate world though I am entirely happy with a one party state running a top down, planned economy of N year plans following CEO-Thought, and with a single repository.
    • friendzis211 days ago
      In trunk based development libraries do break product code, yes, which is (and should be recognized this way) 100% intentional. The other alternative is leaf based development where you have dependency hell because you can&#x27;t force product code to update libraries.<p>Pick your poison - change management is not an easy topic.
  • impure211 days ago
    I love submodules. It&#x27;s similar to using a package manager but allows you to modify the submodules&#x27; code much easier. And as already mentioned you need to use `git config --global submodule.recurse true`. This really should be the default.
    • IshKebab211 days ago
      Submodules are <i>okay</i> in theory. But in practice the actual implementation is very buggy and incomplete. It&#x27;s relatively easy to get into a state where your .git directory is completely broken. Plenty of operations are unreliable to the point that they break CI. They don&#x27;t work with worktrees.<p>On top of that they are needlessly confusing. Why is there a .gitmodules file <i>and</i> hidden state inside the .git directory? Why aren&#x27;t they cloned by default? Many of the UX issues have only been fixed if you turn non-default options on (e.g. the display of diffs can be changed from useless &quot;submodules changed from commit 123 to 456&quot; to &quot;these commits have been added&#x2F;removed&quot;).<p>Just all-round they are a mediocre idea, implemented badly.
    • silasdavis211 days ago
      Absent mindedly moving a submodule breaks everything. It was relatively recently there was even support via git mv.
  • TekMol211 days ago
    I like Git Submodules very much.<p>Are there any downsides to completely skip dependency managers of specific languages and just use submodules to handle dependencies?<p>I don&#x27;t mean code by 3rd parties. I mean the projects and libraries I write myself. I am tempted to try and handle my own code-reuse purely through git submodules. Would I encounter any problems?
    • leni536211 days ago
      &gt; Are there any downsides to completely skip dependency managers of specific languages and just use submodules to handle dependencies?<p>Submodules suck once you encounter a diamond dependency problem.
      • MereInterest211 days ago
        It doesn’t even need to be a diamond to have dependency problems. Suppose I have two dependencies, A and B. Dependency A also depends on B. Now I have two copies of B, one from my submodule and one from A’s submodule, and there’s no guarantee that these are compatible versions.
    • skinner927211 days ago
      We used them for years for dependencies, but have instead moved to a monorepo because of how we want to do releases. We never had any issues while using submodules.
    • imp0cat211 days ago
      I am not sure what exactly are you trying to achieve, but take a look at Meson Wraps.
    • maleldil211 days ago
      If your projects and libraries are public, your package manager will likely let you use Git references (usually commits&#x2F;branches&#x2F;tags) to define dependencies. I find that cleaner than submodules.
  • AceJohnny2212 days ago
    The very short of submodules is this:<p>Git&#x27;s data system has 3 (&amp; 1&#x2F;2) types of objects:<p>1. A blob, which is analogous to a file, and is referenced by the hash of its contents<p>2. A tree, which is analogous to a directory, which contains blobs and other trees, and maps them to names. It is referenced by the hash of its contents.<p>3. A commit, which contains One (1) tree (the top-level of your repo), a reference to one (or more, for a merge) parent commit, and miscellaneous metadata like the author and the commit message. It is referenced by, you guessed it, the hash of its contents! (annotated tags are commit objects)<p>3.5. References, which are analogous to symlinks to commits. Branches and lightweight (non-annotated) tags are References.<p>Now, remember how a tree can contain a blobs or other trees? What if (<i>gasp</i>) you put a <i>commit</i> object in them!? That&#x27;s essentially what a submodule is.<p>That&#x27;s why a submodule is always included _at a particular commit of it_. That&#x27;s why there&#x27;s all sorts of complicated support machinery to make &quot;a commit object inside a tree object&quot; make sense.
    • IshKebab211 days ago
      &gt; a submodule is always included at a particular commit<p>Actually you can make a submodule track a branch instead of a specific commit. I&#x27;ve never seen anyone actually do that though and it seems like a bad idea. Though I did work for a while for a company that had written a custom tool that worked like that and we never ran into any problems due to it.
      • AceJohnny2211 days ago
        I don&#x27;t think it is possible to put a branch name into a tree object, not without deep modifications to git, so I suspect your previous company developed a significantly different tool around it.
        • IshKebab211 days ago
          My previous company wasn&#x27;t using native Git submodules.<p>I think you&#x27;re right actually the submodules. You <i>can</i> associate a submodule with a specific branch, but it still records the hash like normal and you still have to manually update it.
      • eru211 days ago
        What&#x27;s the hash of a branch?
        • IshKebab211 days ago
          It uses the branch name instead of the hash.
  • ChrisMarshallNY211 days ago
    I’ve used submodules a lot, and choose not to use them, anymore. They are just too much work. I now use package managers to accomplish pretty much the same thing.<p>One project that I wrote, used nested submodules. There was a specific reason for the nesting, as it was a layered system, and each layer had a very specific context and functional domain, and submodules helped enforce that.<p>The problem was, it made changes a <i>huge</i> pain. If I made changes in the deeper layers, I’d need to propagate the changes throughout the entire chain, above. I wrote a few bash scripts to handle that, but it was fairly kludgy, and quite brittle.<p>I ended up just folding it all into a monorepo.<p>The one feature that I’d <i>love</i> to see in git, is something that Microsoft SourceSafe could do. I call it “Virtual Repos.”<p>You could make a “repo” that was actually an amalgam of files that were references to files in other repos. Their state in the virtual repo reflected their state in their “home” repo, and changes made in the virtual repo would go out to their home repo.<p>It must be a nightmare to get right, though. I can see why it would not be implemented, but these could be used for a lot of the same things that submodules are used for.
    • arccy211 days ago
      maybe sparse checkouts would be analogous to virtual repos?
      • ChrisMarshallNY211 days ago
        They are similar. I remember cataloging the differences, once, but that was a long time ago.<p>I don’t think sparse checkouts let you “mix and match,” the way virtual repos did.<p>Think of the files in the virtual repo as “symlinks” to their originals, in other repos.<p>Other than that, SourceSafe was kind of a nightmare, and I don’t miss it.
  • dboreham212 days ago
    imho: do not use submodules. Only need to deal with them when working on someone else&#x27;s project where they didn&#x27;t know this rule.
    • dheera212 days ago
      other than the command line UX of submodules being crap, i think they are actually a good system.
      • m463212 days ago
        I think that&#x27;s the nature of git. goes double for lsf.<p>Git reminds me of C - important language, used everywhere, but has never evolved with respect to usability.<p>EDIT: hmm... actually &quot;git switch&quot; was more usable to me
      • Xelynega212 days ago
        What is bad about them on the command line? If you understand git the only extra things you need are `git submodule update --init` and `git submodule add ...`
        • GauntletWizard212 days ago
          The UX that sucks is around what happens if they are unclean&#x2F;how to update them. A checkout doesn&#x27;t recursively checkout the relevant submodules. This is the biggest pain point for most orgs I&#x27;ve worked at. It&#x27;s an easy setting to set (`git config --global submodule.recurse true`) but the fact that it&#x27;s not default hurts.<p>Most engineers have a poor understanding of Git. My university had a great history of version control course right at the dawn of the git era (In 2006! RIT really speedran it, standardizing on Git by the end of the year, but also including tutorials on RCS, CVS, and SVN and a brief foray into Perforce). Still, a ton of my classmates just didn&#x27;t get it.<p>The other major blocker is what to do with an unclean submodule repo; I honestly don&#x27;t remember what git does by default, because it&#x27;s bad. And most projects get unclean real quick. Makefile hygeine is not common, and for most of time most projects became unclean from a simple `make`. It&#x27;s better now, but not great.
          • Xelynega211 days ago
            &gt; Makefile hygeine is not common, and for most of time most projects became unclean from a simple `make`.<p>If you&#x27;re checking generated files into git, submodules aren&#x27;t the problem imo.<p>I can see the frustration of modifying submodules files and trying to commit the main repo, but if you have to do that then it wasn&#x27;t supposed to be a submodule. That&#x27;s like complaining that modifying node_modules files doesn&#x27;t apply upstream to your dependencies.
          • glandium211 days ago
            There are bad interactions with rebase too.
            • usr1106211 days ago
              I have gotten rid of those by the rule: If a commit update updates a submodule, it must not update anything else. (Yes, this can violate the general rule that nothing needs to be added to a commit to be complete. But updating submodules has been worth the exception in my experience.)
              • PokestarFan211 days ago
                I&#x27;m working on a project where pushing a commit to a submodule runs a CI job which updates the reference on the parent repository. This seems to lead to very few issues.
        • Izkata212 days ago
          Add in &quot;--remote --recursive&quot; to the &quot;update&quot; command and you have the same thing as unpinned svn externals.
        • dheera210 days ago
          I can&#x27;t remember whether it&#x27;s<p><pre><code> git update submodule --init git init --submodules --update git init --recursive --submodule --update </code></pre> etc.<p>Git checkout should do that automatically. Checkout a repo, all the submodules automatically checkout. There is no good reason not to.
  • hakanderyal211 days ago
    Checkout git subrepo [0] if you also find working with submodules cumbersome.<p>It has a different set of trade offs and works without any problems or changes to your workflow if they fit. (Only thing it has problems is rebasing, under specific circumstances)<p>[0] <a href="https:&#x2F;&#x2F;github.com&#x2F;ingydotnet&#x2F;git-subrepo">https:&#x2F;&#x2F;github.com&#x2F;ingydotnet&#x2F;git-subrepo</a>
    • IshKebab211 days ago
      It would be nice if they could say how it differs to git subtree. Any idea?
      • hakanderyal211 days ago
        Just checked subtree and while they aim to provide the same thing, they are using different ways.<p>- You can mix subrepo commits and main repo commits freely in a single commit, it’ll take care of submitting only the relevant changes when pushing upstream.<p>- Publishing changes from a subrepo iş just a single command.<p>- Subrepo adds a .gitrepo file to the subdirectory for metadata<p>The readme on repo does a good job of explaining things.
        • IshKebab211 days ago
          I haven&#x27;t ever actually used git subtree to push changes, but I&#x27;m pretty sure that all of those are true for it too, and git subtree <i>doesn&#x27;t</i> need a `.gitrepo` file so that seems like a point in its favour.<p>I&#x27;m sure there are advantages to git subrepo, but I am still not sure what they are.
          • hakanderyal210 days ago
            The downsides from the subtree website [0] doesn’t apply to sub repo.<p>For me, I just use git normally as I would, and do a subrepo push when it’s time. Subtree would make me change my workflow which is a big one for me.<p>[0] <a href="https:&#x2F;&#x2F;www.atlassian.com&#x2F;git&#x2F;tutorials&#x2F;git-subtree" rel="nofollow">https:&#x2F;&#x2F;www.atlassian.com&#x2F;git&#x2F;tutorials&#x2F;git-subtree</a>
  • CSMastermind211 days ago
    After running the platform org at a company that used submodules: never again.<p>There was not a week that went by without me having to unstick some team that had horribly managed to screw things up because of them or watch an engineer burn an entire day fighting with them or watch a new hire completely confused.<p>&quot;Well if everyone would just ...&quot;<p>Everyone is not going &quot;to just&quot;. If your system relies on everyone inherently having the same understanding of the world and behaving in the same way, then it&#x27;s a terrible system.
  • cjfd211 days ago
    This is the article I should have read when first trying to use git submodules. The two main facts &quot;a submodule is another git repository&quot; and &quot;a submudule is always pinned to a specific commit of the other git repository&quot; are the most important things to understand git submodules. Somehow all tutorials&#x2F;examples that I saw before show lots of git commands and their outputs but do not highlight the two basic facts so they actually do not help.
    • dmazin211 days ago
      Hey, I wrote this article. Just wanted to really thank you for saying that. I also felt like &quot;why didn&#x27;t anyone tell me this&quot; so I wanted to share it :-)
    • blueflow211 days ago
      Type `man 7 gitsubmodules` into your terminal.<p>Edit: typo&#x27;ed command
      • cjfd211 days ago
        <p><pre><code> [cjfd@cjfdpc ~]$ man 7 gitmodules No manual entry for gitmodules in section 7</code></pre>
  • tonymet211 days ago
    I recommend trying subtree. for many cases it does what you need . And the other consumers (developers, build systems) don&#x27;t need any special tooling.
    • eru211 days ago
      Yes, that&#x27;s my default suggestion as well.<p>Git subtrees also let you move back and forth between multiple repos vs mono-repo without losing history. So you don&#x27;t need to solve that particular debate in your team.
  • vermilingua212 days ago
    Can anyone speak to usecases for submodules that arent better served by your language’s package manager? Multi-language codebases, languages without appropriate package management perhaps?
    • nrclark211 days ago
      Submodules are great for projects where your code depends on upstream Git repos that you don&#x27;t control and don&#x27;t want to vendor yourself.<p>I recently did an embedded Linux design that depended on 5 external repositories: one from Yocto, three from OpenEmbedded, and one from a CPU vendor. My own code just sat on the top of this set of repos.<p>Submodules made that design very simple. One repo with all of my code in it, and submodules for all external repos. All dependent repos were pinned before of how submodules work. Pins were easy to update when desired, and never move on their own.
      • maleldil211 days ago
        Isn&#x27;t that because you didn&#x27;t have a good package manager to handle these? If you have a package manager that allows you to add packages from Git repos, why would you use submodules?
        • nrclark211 days ago
          Is there a specific package manager that you&#x27;re thinking of? I&#x27;m always open for recommendations.
    • ajfriend212 days ago
      We use a submodule in <a href="https:&#x2F;&#x2F;github.com&#x2F;uber&#x2F;h3-py">https:&#x2F;&#x2F;github.com&#x2F;uber&#x2F;h3-py</a> to wrap the core H3 library, which is written in C. Submodules seemed like a reasonable way to handle the dependency, and, at least for this use case, the approach hasn&#x27;t given me any problems.
    • c0balt212 days ago
      The latter had been an issue for me in the past with some projects that just weren&#x27;t packaged for, e. G., python and had to be imported directly. It can also be helpful for non-packaged assets that are held in a separate git repository.
    • bschwindHN212 days ago
      &gt; Multi-language codebases<p>This is where I use them. I have some Rust bindings to C++ code, and that C++ code lives in my repo as a submodule. Everyone seems to hate submodules I guess because of the surprising behavior described in the post, but for my use case they&#x27;ve been completely fine.
    • foooorsyth211 days ago
      Two of the largest tech companies in the world, Google and Meta, had to roll custom VCS for their day to day engineering operations because git and git submodule were so unsuitable. The default pack file behavior of git is completely unsuitable for a rapidly releasing company with a monorepo. You <i>don’t</i> want or need the entire history — you just want a few recent commits. You <i>do</i> want some visibility into what your coworkers are up to so you can prevent merge conflicts before they happen (centralization is good!). You <i>probably</i> only need part of the tree, not the entire thing.<p>If you go back and watch Linus’ talk at Google regarding git, he’s basically describing (unknowingly) why Google needs to <i>not</i> use git for its day to day. Even on a smaller scale, Android (AOSP) had to create a meta tool for git called git-repo to handle its source tree. Git submodule failed there.
      • eru211 days ago
        &gt; Two of the largest tech companies in the world, Google and Meta, had to roll custom VCS for their day to day engineering operations because git and git submodule were so unsuitable.<p>Where did you get that from? Sources?<p>Google rolled their own VCS, because Google is older than Git, and they needed something that works. Their custom VCS is a hacked up version of Perforce.<p>By the time Git came around, Google was already pretty much committed to their in-house custom tool, too many things relied on it.
      • rcxdude211 days ago
        Git submodules aren&#x27;t really intended for that use-case in the first place. They&#x27;re not really intended to model a mono-repo at all, more a relationship between repositories that have their own histories.<p>The main thing that has been developed in git to allow very large repos is shallow clones (both in terms of history and slices of the repo). This model works well enough within git&#x27;s logic, but it&#x27;s just historically not been focused on until fairly recently (and I don&#x27;t really know what the state of play is there - I think there&#x27;s still a limit at a certain scale where simply finding the state of play of a large checkout becomes a bottleneck, and you start to want a persistent daemon to use FS notifications to keep track of what&#x27;s changed instead of stat()ing every file in the tree)<p>(I&#x27;ve often pondered if it would be possible to make a DVCS where there&#x27;s no firm repo boundary at all, i.e. you could construct a checkout from any combination of trees and commits stored in different locations, and have it work seamlessly. There&#x27;s probably more than a few thorny issues in there, but it would be an interesting concept)
      • jayd16211 days ago
        Don&#x27;t all your examples predate stable git-submodules?
        • staunton211 days ago
          Simce when would you say are git-submodules stable?
    • cxr211 days ago
      Every &quot;language package manager&quot; with a lock file format and requirements file, is an inferior, ad hoc, formally-specified, error-prone, incompatible reimplementation of half of Git.<p>Almost every use case for a package manager is better served by Git, whether you choose to use submodules or not. If you want to do version control, use the version control system, and stop trying to do an end-run around the way it works.<p>Previously:<p>&gt; <i>I&#x27;m happy to criticize NPM the tool. The whole thing is designed as a second, crummier version control system that lives in disharmony with and on top of your base-level version control system (so it can subvert it). It&#x27;s a terrible design.</i><p>&lt;<a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=37604551">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=37604551</a>&gt;
      • eru211 days ago
        Git knows nothing about eg semantic versioning, or how to resolve different requirements from different libraries that you want to use together.
        • cxr211 days ago
          Right.
          • eru210 days ago
            So it might be a decent replacement for a lock file, only.
            • cxr210 days ago
              What?
              • eru209 days ago
                Git only replaces the lock file aspect of package managers, not the version requirement resolution part. (Or the part that tells deals with eg Rust&#x27;s feature selection, or different build instructions for different operation systems or versions of the language etc.)
                • cxr209 days ago
                  &gt; Git only replaces the lock file aspect of package managers<p>Nope, Git is pretty good about downloading stuff over the network, too. In fact, it&#x27;s so good at it that many people using a language package manager insist you use Git at some point even when (before) using the package managers. Indeed, there&#x27;s been a lot of trepidation and gnashing of teeth about whether the places where language package managers download packages from are as reliable&#x2F;trustworthy as the server where the Git repo for the software project is hosted.<p>&gt; nothing about eg semantic versioning, or how to resolve different requirements from different libraries<p>&quot;[…] incompatible reimplementation of _<i>half</i>_ of Git.&quot;
    • dirkt211 days ago
      I have used them for OpenAPI specs shared between frontend and backend, and database schemas together with values for a test database in the pipeline.<p>Yes, you can also solve this with a monorepo...
      • eru211 days ago
        You can use git subtree to convert between mono-repo and separate repos, without losing your history. You can even keep both styles up to date concurrently.
  • megamix211 days ago
    Git - 100+ flags and commands when you only need 3-5.
    • bvrmn211 days ago
      Actually it&#x27;s backwards. Git gives ability to manage and navigate commit graph on quite low level using a pair of commands: checkout and reset and fulfill any wild desires. While in other VCSs it&#x27;s a separate command per case.<p>Note: I think GIT UX is horrible and requires multiple years of practice to be comfortable with.
    • eru211 days ago
      Most of the time, you only need a handful of commands, but there&#x27;s a long tail of niche situations, especially if you are using git for maintaining a large project like the Linux kernel.<p>Remember, git was designed and written for the kernel first and foremost.
      • megamix206 days ago
        But it&#x27;s used widely in projects that are not the Linux kernel. So what should they do, fork Git and create a LITE version? :)
      • megamix206 days ago
        Also, do you have examples of niche situations?
  • abdullahkhalids211 days ago
    I am running simulations with a rapidly evolving codebase. I have a separate repo with all the simulation code in it. I am want to tie each simulation with the git commit (of the main repo) at which it was run. Are git submodules the correct solution to this in any way?
    • banditelol211 days ago
      I think you want something aling the line of dvc (github.com&#x2F;iterative&#x2F;dvc)
    • swinglock211 days ago
      Perhaps. Tags might be fitting instead.
  • yig211 days ago
    For C++, I&#x27;ve started using FetchContent as a kind of distributed package manager. When I think about it, why is that better than git submodules?
  • 0x69420212 days ago
    understanding submodules has not caused me to stop wishing that something in the vein of nix (in the sense of being able to provide a &quot;lockfile&quot; that transcends language-level package managers) becomes sufficiently commonplace that people would feel silly doing anything other than using whatever that turns out to be, or just directly vendoring if all else fails
  • vsskanth212 days ago
    speaking of submodules, anyone here have experience with git subrepo ?
    • metadat212 days ago
      Subrepos are non-standard and don&#x27;t offer any significant benefit compared to submodules.<p>Even still, submodules are also best avoided.
  • the_clarence211 days ago
    Does Meta sapling git wrapper facilitates working with submodules?
  • pictur211 days ago
    [dead]