Reputation: 5613
There's a small library in some big project (in a git repo), that I believe can be factored out of this big project, and so benefit people who need just the small library.
The small library is a subdirectory in the big project.
What's the best way to do it? Specifically, I'm asking how not to lose ties to the parent project, so I can:
I was thinking of just forking and then moving and deleting items with git, but I'm not sure whether it'll preserve sufficient ties to the parent project.
Upvotes: 4
Views: 86
Reputation: 691
Use git subtree, you can:
The better than submodule is, your upstream will keep same as before, nothing changed in it.
Upvotes: 3
Reputation: 1326872
forking and then moving and deleting items with git, but I'm not sure whether it'll preserve sufficient ties to the parent project.
Once you have done that, you would still need to declare that new repo (for the small library) as a submodule in your big project repo (see git submodule
).
That way, you will keep an exact reference to a specific version of that library repo, and will still be able to contribute from said library (see "true nature of submodules").
Upvotes: 3