Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 33 lines (26 sloc) 760 Bytes
#!/bin/bash -e
## Do a recursive checkout
## this includes removing orphaned directories
## and attaching heads.
## read input, display help if necessary
if [[ "$@" == "" || "$@" == *--help* ]]; then
cat<<EOF
Recursive checkout
This command is like git-checkout, but acts recursively, i.e.,
makes sure that the submodules are at the correct commit,
their HEADs are attached if possible and orphaned submodule
directories are removed.
Usage:
git rcheckout ...
...: same arguments as git-checkout
EOF
exit 0;
fi
## check for modified content and uncommitted changes
git check-clean || exit 1
## do the checkout
git checkout "$@" || exit 1
## fix submodule
git fix-submodules --skip-checks
## attach head (necessary?)
git attach-head