/bin/log

Log my thoughts

Home About GitHub

08 Oct 2013
Git submodule workflow

git submodule workflow

  1. Add submodule repo.git

    git submodule add repo.git ./path/to/submodule

  2. Update submodule

    git submodule foreach git pull

  3. If submodule contain submodule

    git submodule update --recursive

  4. Specify branch to update

    git submodule foreach git pull origin master


clone repo contains submodule

$ git clone repo
$ git submodule init
#pull submodule and checkout the current version
$ git submodule update

One command trick:

git clone --recursive repo


Carpe diem,
JZR at 01:48

Home About GitHub