iCodeLikeImDrunk
iCodeLikeImDrunk

Reputation: 17846

is there a way to load non-editable/read-only git submodule?

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?

Upvotes: 4

Views: 1927

Answers (1)

Augusto
Augusto

Reputation: 29977

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.

Upvotes: 5

Related Questions