What I'm trying to do
Here's my github repository:
https://github.com/dharmatech/LinkAggregatorTutorial
Inside that repository is a PowerShell script: LinkAggregatorTutorial.ps1
That script generates a new git repository, named LinkAggregator.
Ideally, I'd like to keep that generated repository inside the LinkAggregatorTutorial repository.
The issue
The issue is, I would imagine that this is an unusual arrangement; i.e. having a repository inside another repository.
I did a little bit of research on this topic and found git submodules. However, at first glance, my use case doesn't seem to be exactly the right target for submodules. The generated git repository (LinkAggregator) isn't a dependency of the parent repository (LinkAggregatorTutorial).
So my question is, is there a good way to set this up?
Options
To summarize, my current options are:
- Just put
LinkAggregatorinsideLinkAggregatorTutorialand it'll just work. - Make
LinkAggregatora submodule ofLinkAggregatorTutorial - Don't try to keep
LinkAggregatorinsideLinkAggregatorTutorial. Simply host it in another repository on github. (Although, then I seem to run into the same issue there. Moreover,LinkAggregatorcan't really be a top-level standalone repository since it is generated from scratch every so often.) - Generate
LinkAggregatorinsideLinkAggregatorTutorialbut then remove theLinkAggregator/.gitdirectory, rendering it just a normal folder with files in it as opposed to a full on git repository. The drawback is, it's no longer a repository, but I may be able to live with that. The important thing is that the user can see the generated project. If the user generates the project on their system, they'll of course still get the full git repository. - Have
LinkAggregatorTutorial/.gitignoreincludeLinkAggregator/.git. This way, locally,LinkAggregatoris still a git repository. But as far as github is concerned, it's just a regular folder. - Some other arrangement...
More context
A little more context:
- LinkAggregatorTutorial.ps1 is a PowerShell script that generates the
LinkAggregatorrepository (it's an ASP.NET Core project). - Every once in a while, I'll be updating LinkAggregatorTutorial.ps1 and then regenerating the
LinkAggregatorrepository. Thus, I won't be making little incremental updates toLinkAggregator(as is normally done with a git repository). It's automatically generated and thus, a completely new repository will be generated from time to time. It's this repository that I'd like to have insideLinkAggregatorTutorial. - LinkAggregatorTutorial.md is the rendered version of tutorial. The reader is meant to go through that manually. However, then can, if they choose, run the tutorial to generate the final project, just to test if the steps work on their system. I'd like to, of course, also provide the generated project on github.
Update
Upon writing all this out, it seems like option 4 is a practical approach and I'm leaning towards it. But, I figured I'd leave this question up to see if a git wizard has any thoughts or suggestions on this scenario.