dotwryn/bin/git/submodule-update-master-commit
2021-09-16 11:05:48 -06:00

16 lines
293 B
Bash
Executable File

#!/bin/zsh
git submodule update --remote --rebase --init
SUBMODULES=$(\
git status\
| grep '(new commits)' \
| sed 's/^.*modified:\s*//; s/\s*(new commits).*$//' \
)
[[ ${#SUBMODULES[@]} -gt 0 ]] && {
git add $SUBMODULES
git commit -m "Updated submodules to master : $SUBMODULES"
}