DEV Community

QJ Li
QJ Li

Posted on

3 3

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)

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →