I have a project consisting of a library and various applications:
foo/
foolib/
bar/
baz/
qux/foo/
All of the applications link against foolib, a static library.
I would like git commit on foo to record the SHA1 ID of where foolib was at, and also git status on foo to report if there are uncommitted changes in foolib.
However I do not want to move foolib to having a copy of it as a subdirectory of every application. As well as being bloaty, this would lose the ability to try out some changes to foolib in multiple applications without committing the changes.
I have tried making a .gitmodules file that points to ../foolib but it seems to be completely ignored by git status. I also tried making foolib a softlink inside foo, but git seemed to treat the softlink as a file instead of following the link.
Is what I want possible, or do you have any alternative workflow solutions?
On my public repository, the structure is the same, and each application (and foolib) has been cloned individually from the public.
The idea would be to create another repo fooProject
, which would declare as submodules:
foo
foolib
(If you call your parent project appProjects
instead of fooProject
, you could declare as submodules all the sub-directories: foo
, foolib
, bar
, baz
, ...)
If any of the sub-directories (foo
or foolib
) changes and makes a new commit, you go back to the parent repo and commit as well, in order to record the SHA1 of the different submodules.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With