Submodules

A Few git configuration

git config --local diff.submodule log
git config --local alias.spush 'push --recurse-submodules=on-demand'
git config --local status.submoduleSummary true  // Very good.
git config --local diff.submodule log  // Alternative git diff --submodule=log
git --recurse-submodules [git-repo-url] // Clone
git submodule add [git@github.com:your-account/umbrella-ui.git] [name] // Add new subrepo
git submodule update --remote --recursive

After working on it

// fetch all new updates in submodule
git submodule update --remote 

// add all submodules changes
git add .

// commit new pointers
git commit -m “Update submodule pointers”

// publish the changes
git push origin master

// Shortcut
git submodule update --remote --merge // Didnt work
git submodule update — init — recursive //in order to auto-init any new submodule, 
//and to recursively update these if need be

// Alias
git config --local alias.spull '!git pull && git submodule sync --recursive && git submodule update --init --recursive'
// Alternative alias
git config --global alias.spull '__git_spull() { git pull "$@" && git submodule sync --recursive && git submodule update --init --recursive; }; __git_spull'

// Pull and update recursively. 
git config --global alias.update '!git pull && git submodule update --init --recursive'