19 lines
598 B
Batchfile
19 lines
598 B
Batchfile
@echo off
|
|
REM ==============================================================
|
|
REM Force update all submodules to the latest commit from their remote branch
|
|
REM ==============================================================
|
|
|
|
cd /d %~dp0
|
|
|
|
echo.
|
|
echo === Updating parent repository ===
|
|
git pull --recurse-submodules
|
|
|
|
echo.
|
|
echo === Forcing submodules to latest remote branches ===
|
|
git submodule foreach --recursive ^
|
|
"echo Updating $name && git fetch origin && git checkout $(git symbolic-ref --short HEAD) && git reset --hard origin/$(git symbolic-ref --short HEAD)"
|
|
|
|
echo.
|
|
echo === Done! ===
|
|
pause
|