![]() ![]() Having a stable interface between two projects is a key in limiting the interactions. I.e., to encode information like "for commit X, we need commit Y of submodule A". I use submodules often as some kind to ensure that code is reproducible (actually, that's what version control is for, after all). Submodules make mostly sense if you only rarely update the submodule (not sure about subtrees, though). commit the new submodules HEAD in the superproject.manually check out the latest version within the submodule.Specifically, every time you want to update your submodule, you have to The submodule stores only the commit id, but never a specific branch.The current commit of the submodule is stored in every commit of the superproject.(By interaction, I mean that small changes to the submodule require changes to the subproject.) Requirement 4 can be achieved by subtrees, but only in a limited fashion by submodules.įirst, please note that having many interactions between different projects/repos necessarily requires many interventions to keep the projects in sync. Your requirements 1-3 can be achieved by submodules. I've looked at Differences between git submodule and subtree and Vendor Branches in Git, but neither seem to offer exactly the functionality I'm asking for - is it possible to implement with Git? Is it possible without a lot of extra moving/renaming/checking out directories? Commit and push changes to the library project from within the superproject.Īs far as I'm aware #1 and #4 are supported by Git submodules (even though #4 requires a few extra checks to make sure you're on the right branch).It would also be nice (but not required) to be able to: Use library development branch when on superproject development branch.Use library master branch when on superproject master branch.Commit and push changes in a separate clone of the library project which are not updated in the superproject until explicitly asked for.I've been looking into Git submodules to make a "Git project inside a Git project", but I've run into an issue that tells me submodules might not be the right solution.Ĭurrently I have a single project with multiple branches (master and development) and a library that I would like to separate into it's own Git project (so it can be developed independently and with it's own commit history). ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |