the git command "submodule" downloads the whole source of the project AND it is editable...
is there a way to make the submodule read only?
I just want to have one of my git projects to be dependent on another, maybe submodule is not the correct way? what is a better/correct way of accomplishing this?
This doesn't really answer your question, but I think you're looking for git subtree. Which is like git submodule, but better (and waaay better if you don't want push updates). Unfortunately, I don't think you can make it read only.
Taken from the example in the page above:
git subtree add --prefix [folder where you want the copy] [repo to clone] master --squash
for example
git subtree add --prefix .vim/bundle/tpope-vim-surround \
https://bitbucket.org/vim-plugins-mirror/vim-surround.git master --squash
The main benefit of subtree is that you don't need to run extra commands to download the rest of the code, as with 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