DEV Community

QJ Li
QJ Li

Posted on

git tips - run git pull over all subdirectories

Pretty handy tips that I use time to time.

Mac / Linux

ls | xargs -I{} git -C {} pull

// run in parallel
ls | xargs -P10 -I{} git -C {} pull
Enter fullscreen mode Exit fullscreen mode

Windows

The good old DOS batch file:

@echo off
for /f %%f in ('dir /ad /b') do (
 cd "%%f"
 git pull
 cd..
)
Enter fullscreen mode Exit fullscreen mode

Reference:

https://stackoverflow.com/questions/3497123/run-git-pull-over-all-subdirectories

Top comments (0)