:: git-pull-all.bat
@ECHO OFF
SETLOCAL ENABLEEXTENSIONS

SET MYGIT="C:\Program Files\Git\bin\git.exe"
FOR /D %%X IN (*) DO (
    IF EXIST "%%X\.git\" (
        CD /D "%%X"
        ECHO ===== git pull %%X
        %MYGIT% checkout test
        %MYGIT% pull --recurse-submodules=yes --ff-only --all --progress
        CD /D ..
    ) ELSE ECHO ..... Skipped %%X
)

:bye
PAUSE
ENDLOCAL

第二种 实现方式

@echo off
set dir=%~dp0
set branch=test

cd %dir%
for /d %%i in (%dir%*) do (
cd %%i
git fetch
git checkout %branch% 
git pull origin %branch%
cd ../
echo %%i
)
pause

 

相关文章:

  • 2021-12-18
  • 2022-12-23
  • 2021-11-06
  • 2022-12-23
  • 2021-06-24
  • 2021-08-20
  • 2022-12-23
猜你喜欢
  • 2022-01-16
  • 2022-01-31
  • 2022-01-06
  • 2021-04-24
  • 2022-02-25
  • 2022-12-23
  • 2022-01-13
相关资源
相似解决方案