[Git] Adding a git submodule
sample project architecture
+ node_modules
+ lib
+ ux
+ subsite *submodule goes here*
server.js
Adding the module
# Reference the submodule in git
$ git submodule add username@url:repo target/folder
# required?
$ git submodule init
# pull the code
$ git submodule update
βπ’ βοΈ note for node repository βπ’ βοΈ
donβt forget to run npm install in submodule
$ cd path/to/submodule
$ npm install
Cloning a repo with submodules:
$ git clone --recursive path/to/remote/repo [local/path]
Documentation
- https://chrisjean.com/git-submodules-adding-using-removing-and-updating/ βββββ
- https://git-scm.com/docs/git-submodule
- https://github.com/npm/npm/issues/6700
Published
13 December 2016