Skip to content

Instantly share code, notes, and snippets.

@luochen1990
Created June 14, 2017 03:14
Show Gist options
  • Save luochen1990/7e0af1cdcb504a572b7328c82f200931 to your computer and use it in GitHub Desktop.
Save luochen1990/7e0af1cdcb504a572b7328c82f200931 to your computer and use it in GitHub Desktop.
User defined Git Command to auto update submodule when checkout branch.
#!/bin/sh
# add this file to your path so that you can run it as an git command via `git checkoutr xxx`
br=$1
test -z $br || git checkout $br
git submodule update --init --recursive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment