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

Categories

Tags