make git submodules usable

September 16, 2015 · View on GitHub

This overwrites the 'git' command with modifications where necessary, and

calls the original otherwise

git() { if [[ @==clone]];thengitargs=@ == clone* ]]; then gitargs=(echo "@"cutc6)commandgitclonerecursive@" | cut -c6-) command git clone --recursive gitargs elif [[ @==pull]];thencommandgit"@ == pull* ]]; then command git "@" && git submodule update --init --recursive elif [[ @==checkout]];thencommandgit"@ == checkout* ]]; then command git "@" && git submodule update --init --recursive else command git "$@" fi }