![]() Make sure you understand them, make sure they're what you need. There are powerful reasons to use submodules. They might find it most convenient to configure the shared library repository as a submodule, so it's all in the same managed source tree, and every developer working on the application would be on the same page. Such application authors could easily be working on code in both the shared library, and in the application, at the same time. Stated generally, one or more application authors might directly embed a given library in their applications. Rather than rely on the MP3 library being installed as a shared library on any computer where the app is installed, the application developers might choose to directly embed the library into their compiled application. For example, someone might have created a really good MP3 library that's used in multiple audio player applications. That question led to Git submodules, and here we are.Ī more typical reason to use Git submodules is the developers of a set of applications who need to include the same library (or libraries) across those applications. But when I decided to remove the documentation files from the npm packages, to reduce the package size, it meant finding another solution. That meant the documentation could be found inside the node_modules directory tree. In the past, this was handled by embedding the documentation inside each npm package. In other words, constructing the website requires assembling into one directory tree the content of a dozen or more Git repositories. But, getting all that documentation to show on requires somehow bringing everything together into one source tree. The documentation for each package is therefore tracked in parallel with its changes. The akashacms/akashacms-website repository holds a portion of the content appearing on, and the rest is spread across the repositories for each AkashaCMS package. There are many many modules involved with AkashaCMS, each of which has documentation in the corresponding repository. That website documents the AkashaCMS family of tools, a static website generator platform. Why did I decide to look into using Submodules? It was an issue with the source code repository for the Using them adds complexity, so it had better be worth your time. I'm sure most of us might go for a whole software development career without using something like submodules. I've used Git for many years without needing to know about submodules. If there are commits in the repository for a submodule, the submodule SHA commit reference will not be updated until you must run a Git command for that purpose.Anyone who clones the parent repository must remember to run a Git command to cause the submodule repositories to also be checked out.But, as said earlier, this comes with increased complexity. Those attributes are a rough summary of the advantages. Each parent project has control over which release of each subsidiary project is being used, and each parent project can push changes to the subsidiary projects. ![]() Each submodule can be used by multiple parent projects. submodules, of this hierarchy are independently managed, with each being versioned on its own schedule. What can you do with a Git repository containing or embedding one or more other repositories?Īt it's core, submodules lets you construct a directory hierarchy containing data (source files) from multiple locations. The only record in the parent repository is the SHA commit identifier of the commit to use in the child. But changes in the child repository are tracked by the child rather than parent repository. The files of the child repository appear within the file tree of the parent. With the submodules feature, you're effectively embedding a child Git repository into a parent repository. Similarly, Git submodules are extremely useful, and you must be certain they are the correct solution for your problem. ![]() Regular expressions are extremely useful, and you must be certain they are the correct solution. That's a quip of a famous quip about regular expressions. As they say:Ī programmer had a version control problem and said, “I know, I’ll use submodules.” Now they have two problems. ![]() Before heading down this road, you should be certain the result will be worth the complexity. Using Git submodules will increase the complexity of your project. ![]()
0 Comments
Leave a Reply. |