c_101/更新并拉取仓库.bat

82 lines
1.8 KiB
Batchfile
Raw Normal View History

@echo off
REM 1. <20><>֤<EFBFBD><D6A4>ǰ<EFBFBD><C7B0>֧<EFBFBD>Ƿ<EFBFBD>Ϊ Dev <20><>֧
echo <20><><EFBFBD>ڼ<EFBFBD><DABC>鵱ǰ<E9B5B1><C7B0>֧...
for /f "tokens=*" %%i in ('git rev-parse --abbrev-ref HEAD') do set branch=%%i
echo <20><>ǰ<EFBFBD><C7B0>֧: %branch%
if "%branch%" neq "Dev" (
echo <20><><EFBFBD><EFBFBD>: <20><>ǰ<EFBFBD><C7B0>֧<EFBFBD><D6A7><EFBFBD><EFBFBD> 'Dev'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>л<EFBFBD><D0BB><EFBFBD> 'Dev' <20><>֧<EFBFBD><D6A7>
pause
exit /b 1
)
REM 2. <20><><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD>δ<EFBFBD><EFBFBD>ĸ<EFBFBD><C4B8><EFBFBD>
echo <20><><EFBFBD>ڼ<EFBFBD><DABC><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD>δ<EFBFBD><EFBFBD>ĸ<EFBFBD><C4B8><EFBFBD>...
git diff --quiet
if %errorlevel% neq 0 (
echo <20><><EFBFBD><EFBFBD>: <20><><EFBFBD><EFBFBD>δ<EFBFBD><EFBFBD><E1BDBB><EFBFBD>޸ģ<DEB8><C4A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E1BDBB><EFBFBD>ݴ<EFBFBD><DDB4><EFBFBD><EFBFBD>ġ<EFBFBD>
pause
exit /b 1
)
REM 3. <20><><EFBFBD><EFBFBD><EFBFBD>ݴ<EFBFBD><DDB4><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD>δ<EFBFBD><EFBFBD>ĸ<EFBFBD><C4B8><EFBFBD>
echo <20><><EFBFBD>ڼ<EFBFBD><DABC><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD>ݴ<EFBFBD><DDB4>ĸ<EFBFBD><C4B8><EFBFBD>...
git diff --cached --quiet
if %errorlevel% neq 0 (
echo <20><><EFBFBD><EFBFBD>: <20><><EFBFBD><EFBFBD><EFBFBD>ݴ<EFBFBD><DDB4>ĸ<EFBFBD><C4B8>ģ<EFBFBD><C4A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E1BDBB>ȡ<EFBFBD><C8A1><EFBFBD>ݴ档
pause
exit /b 1
)
REM 4. <20><><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD>δ<EFBFBD><CEB4><EFBFBD>ٵ<EFBFBD><D9B5>ļ<EFBFBD>
echo <20><><EFBFBD>ڼ<EFBFBD><DABC><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD>δ<EFBFBD><CEB4><EFBFBD>ٵ<EFBFBD><D9B5>ļ<EFBFBD>...
git ls-files --others --exclude-standard
if %errorlevel% == 0 (
echo <20><><EFBFBD><EFBFBD>: <20><><EFBFBD><EFBFBD>δ<EFBFBD><CEB4><EFBFBD>ٵ<EFBFBD><D9B5>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƚ<EFBFBD><C8BD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD>ӻ<EFBFBD><D3BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǡ<EFBFBD>
pause
exit /b 1
)
REM 5. <20><>ȡԶ<C8A1≯<EFBFBD><CCB8>²<EFBFBD>Ĭ<EFBFBD><C4AC>ʹ<EFBFBD><CAB9>Զ<EFBFBD>˵<EFBFBD><CBB5>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD>кϲ<D0BA>
echo <20><><EFBFBD>ڴ<EFBFBD> origin/Dev <20><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD>...
git fetch origin Dev
if %errorlevel% neq 0 (
echo <20><><EFBFBD><EFBFBD>: <20>޷<EFBFBD><DEB7><EFBFBD> origin/Dev <20><>ȡ<EFBFBD><C8A1><EFBFBD>¡<EFBFBD>
pause
exit /b 1
)
echo <20><><EFBFBD><EFBFBD>ʹ<EFBFBD><CAB9> 'theirs' <20><><EFBFBD>Խ<EFBFBD><D4BD>кϲ<D0BA>...
git merge --strategy=recursive --strategy-option=theirs
if %errorlevel% neq 0 (
echo <20><><EFBFBD><EFBFBD>: <20>ϲ<EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD><DCA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֿ⡣
pause
exit /b 1
)
REM 6. ȷ<><C8B7> LFS <20>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD>
echo <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȡ LFS <20>ļ<EFBFBD>...
git lfs pull
if %errorlevel% neq 0 (
echo <20><><EFBFBD><EFBFBD>: Git LFS <20><>ȡʧ<C8A1>ܣ<EFBFBD><DCA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> LFS <20><><EFBFBD>á<EFBFBD>
pause
exit /b 1
)
REM 7. <20><><EFBFBD><EFBFBD><EFBFBD>ֿ<EFBFBD><D6BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
echo <20><><EFBFBD>ڼ<EFBFBD><DABC><EFBFBD><EFBFBD>ֿ<EFBFBD><D6BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>...
git fsck --full
if %errorlevel% neq 0 (
echo <20><><EFBFBD><EFBFBD>: Git fsck <20><><EFBFBD><EFBFBD>ֿ<EFBFBD><D6BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E2A3AC><EFBFBD><EFBFBD><EFBFBD>
pause
exit /b 1
)
REM 8. <20><>ִͣ<CDA3><D6B4>
echo <20><><EFBFBD>в<EFBFBD><D0B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɣ<EFBFBD>ִ<EFBFBD>гɹ<D0B3><C9B9><EFBFBD>
pause
<EFBFBD><EFBFBD>ϣ<EFBFBD><EFBFBD><EFBFBD>ڵ<EFBFBD>REM4<EFBFBD>׶<EFBFBD>
echo <20><><EFBFBD><EFBFBD>: <20><><EFBFBD><EFBFBD>δ<EFBFBD><CEB4><EFBFBD>ٵ<EFBFBD><D9B5>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƚ<EFBFBD><C8BD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD>ӻ<EFBFBD><D3BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǡ<EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD>ʹ<EFBFBD><EFBFBD> <20><EFBFBD>ļ<EFBFBD>.bat
ȷ<EFBFBD>ϵĻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ǵ򿪵<EFBFBD>ǰĿ¼<EFBFBD>µĸ<EFBFBD>bat<EFBFBD>ļ<EFBFBD>