Meaning that when working with submodules - this rare git case becomes norm. NB! This is very important to remember that submodule linking sets included submodule into detached HEAD state. gitmodules file (in root folder of parent repository). Information about just added submodule is written in. Later we can repeat the same exercise for EPiServer repository as well. This will link main package current HEAD to the aspnet repository under lib/localization-provider resulting content of the main repository becoming as part of (submodule) aspnet repository. $ git submodule add lib/localization-provider Keep in mind that linking is possible by pointing to some directory under which linked repository content will be "cloned". This is achievable by "linking" main repository content into aspnet. We need to " include" projects from main repository into aspnet repository. Then I would be able to debug it through, change and adjust on-demand if needed, etc. Now tricky part is that I would like to include source from main repository as part of the solution - like normal projects. Create Repo With SubmoduleĪfter we have main module repository available, we can create new one for Asp.Net Mvc ( aspnet) packages. $ git init mainĪfter whole code-base has been moved in, we can push it out to GitHub. We create repository for localization provider core/common module. netcore (.NET Core repository, has dependency on main).
![git add remote submodule git add remote submodule](https://i.stack.imgur.com/4Bn6j.png)
epi (repository for EPiServer integration, has dependency on main and aspnet).aspnet (repository for Asp.Net Mvc applications, has dependency on main module).main package repository (core/common functionality).You start with top-level module repo which does not have any external dependencies on any other module (core/common functionality). Now when you have decided module boundaries it's time to create repositories for each of the module. Create Repositories with Submodules Create Main Module Repo This gives nicer debugger experience for developer without any hustle to enable symbols and be able to "step into" the package source code. Decision has to be made around type locations - where each type should go and which project will be used where.Īctually for development purposes using ordinary project reference is much more preferred way to work with. It's important to understand where each module ends and where next begins as you be referencing each other through sort of NuGet package references.
![git add remote submodule git add remote submodule](https://erttyy8821.gitbooks.io/android_memo/content/assets/submodule5.jpeg)
This is a blog post about the stuff I had to do. So decided to split whole code-base into git submodules and setup separate repositories for each of the sub-systems.