diff --git a/update_submodules.sh b/update_submodules.sh index e76f5a33..01d00c7b 100755 --- a/update_submodules.sh +++ b/update_submodules.sh @@ -4,20 +4,20 @@ timestamp=$(date +%s) for version in 1.04 1.05 2.01 2.02 2.03; do - # Checkout to the specified version for the SSOT directory - git checkout version-$version - - # Pull the latest code from origin for this version (i.e. Git branch) of the SSOT directory - git pull origin version-$version + # fetch the latest version from the remote + git fetch origin version-$version - # Check out a new branch to get around branch protection - git checkout -b update-submodules-$timestamp-$version + # Checkout to the specified version for the SSOT directory + git checkout --force origin/version-$version # Discard local changes to submodules # See: https://stackoverflow.com/a/27415757/2323348 git submodule deinit -f . git submodule update --init + # Check out a new branch to get around branch protection + git checkout -b update-submodules-$timestamp-$version + # Pull the latest versions of submodules git submodule update --remote