git在windows下切換(checkout)分支拉取(pull)最新代碼

:: 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

第二種 實現方式git

@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
相關文章
相關標籤/搜索