]> Tony Duckles's Git Repositories (git.nynim.org) - dotfiles.git/blob - bin/git-subup
.vim/bundle: Use https:// rather than ssh:// for submodule repo's
[dotfiles.git] / bin / git-subup
1 #!/bin/bash
2 # Checkout and update source for all registered submodules (.gitmodules).
3 # Optionally 'git pull' on each submodule to check for updates.
4
5 # Change to root directory
6 cd $(git rev-parse --show-toplevel)
7
8 # Ensure all submodules (and child submodules) are checked-out
9 git submodule update --init --recursive
10
11 # Update submodules' remotes based on .gitmodules
12 git submodule sync
13
14 if [ "$1" = "pull" ]; then
15 # Fetch & pull any new updates from submodule's origin (but *NOT* any child
16 # submodule updates -- those should come from the submodule proper)
17 git submodule foreach 'git-up origin'
18 fi