-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathreset_submodules.bat
36 lines (29 loc) · 1.05 KB
/
reset_submodules.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
@echo off
setlocal
REM 定义子模块路径和URL
set SUBMODULE1_PATH=UnitTests/External/googletest
set SUBMODULE1_URL=https://github.com/google/googletest.git
set SUBMODULE2_PATH=Benchmark/External/Celero
set SUBMODULE2_URL=https://github.com/DigitalInBlue/Celero.git
REM 强制取消初始化子模块
echo Deinitializing submodules...
git submodule deinit -f -- %SUBMODULE1_PATH%
git submodule deinit -f -- %SUBMODULE2_PATH%
REM 删除子模块目录和 .git 中的子模块配置
echo Removing submodule directories and configurations...
rd /s /q %SUBMODULE1_PATH%
rd /s /q %SUBMODULE2_PATH%
git rm -f %SUBMODULE1_PATH%
git rm -f %SUBMODULE2_PATH%
rd /s /q .git\modules\%SUBMODULE1_PATH%
rd /s /q .git\modules\%SUBMODULE2_PATH%
REM 重新添加子模块
echo Re-adding submodules...
git submodule add --force %SUBMODULE1_URL% %SUBMODULE1_PATH%
git submodule add --force %SUBMODULE2_URL% %SUBMODULE2_PATH%
REM 强制更新子模块
echo Updating submodules...
git submodule update --init --recursive --force
echo Submodules have been reset and updated.
endlocal
pause