![]() ![]() Whenever the commit currently checked out in the src/common repository is different than the one contained in the virtual src/common file, Git will detect this as a difference. From the perspective of the parent repository, Git pretends that the mount point path, such as src/common, is a virtual file, whose content is the commit hash of the submodule that should be checked out. This information is part of the regular commits of the parent repository. gitmodules file contains information regarding which submodules there are, and where to clone them from, it does not contain the specific commit of the submodule that should be checked out by the parent repository. gitmodules file is a simple text file, committed to each parent repository as regular file, even though it starts with “.git”. the content of folder src/common is a regular Git repository (with a. For each submodule, it contains the relative “mount point” path in the parent repository (which is src/common in this case), and the Git remote URL, which the Git binary needs, for it to know where to clone the submodule from. gitmodules file states which submodules the parent repository has. The two “parent” repositories named client and server both reference the repository named common as submodule. Let’s consider the following graphical illustration of the example I presented in the Introduction section. In this article I’ll try to make the concepts and commands as clear as possible, and also provide a few tips specific to the Git interface of JetBrains IDEs (e.g. I really would like to use git submodules, but it seems like it won't work in my situation, and instead would create multiple copies of each library repo.While Git submodules provide a powerful mechanism to structure your repositories and avoid code duplication, there are caveats! Submodules make checking out and committing code more complex and error-prone. I am thinking of just having a Makefile and some make tasks to download all the repos at the same directory level (not as submodules), and then setup symlinks, sort of like npm link. How can I do like that "symlink a single clone locally" link at the very top of this post? How can I create a good workflow for people trying to contribute to the "framework-library"? They should clone that, and it autoclones the other repos and keeps it all organized. Not ideal either, but better than creating multiple copies of the repo and accidentally making changes in one and not another and then things become confusing and a mess of "which one is my main version of this library?" type of thing. path between projects temporarily as I do stuff. native-wrapper-libraryĪnd just symlinking or even hardcoding a. I have just been currently leaving it like this.
0 Comments
Leave a Reply. |