註記改英文
Sure, here's the batch script with comments in English:
@echo off
setlocal
set "projects_dir=C:\path\to\projects"
echo Entering subdirectories within %projects_dir%...
for /D %%d in ("%projects_dir%\*") do (
echo Entering subdirectory %%d
pushd "%%d"
git pull
popd
)
echo Execution completed
pause
This batch script will find all subdirectories (one level deep) within the specified C:\path\to\projects
directory, enter each subdirectory, execute git pull
command, and finally display "Execution completed" before pausing the screen awaiting any key press to exit. You can copy this code and save it as a .bat
file, then execute
it in the command prompt.