Here is situation:
# Want this folder to be "umbrella" in order not to spawn
# a lot of github repos later on (you can consider it
# dotfiles-like repository with a lot of remotely pulled
# projects where each should be occasionally updated
# and "custom" patches applied)
mytoolbox/
.git/
proj1/
.git/
..
proj2/
.git/
..
proj3/
.git/
..
file1
file2
..
After some googling I stambled upon git submodule
and subtrees
. The first one seems like just keep tracking the last commit and reference to the remote (list of links without actual content under .gitmodules
). And - after several attempts - I didn't get the idea of the second one if it fits my purposes. May be someone can suggest a better solution in general.
Frankly speaking, a while ago I used Dropbox for this purpose :)
2-part answer:
What's the idea behind git subtree? The purpose of git subtree is just to have a full copy of the other repository within your parent repository. It's basically just some scripting around vanilla git, so your other users will not have to do submodule commands to access the subtree content, but it's effectively the same idea.
Suggest a better solution? Subtree is the better option compared to submodules in my personal opinion, due to the lack of extra commands, and simplicity it provides, but it can easily get you into trouble, like when rebasing.
I'm currently using git subrepo which is exactly the same fundamental idea as subtree but executed better, and more thoughtfully, as to avoid some of the downsides. I have some extra scripts I do when rebasing though to patch pointers to parents, so it's not perfectly trivial, but it's the best option in 2018 that I've found.