Monday, 15 August 2011

Run git pull over all subdirectories windows command promt -



Run git pull over all subdirectories windows command promt -

how can update multiple git repositories shared parent's directory without cd'ing each repo's root directory on windows 7 ?

i have next separate git repositories (not submodules):

c:\projects\repos\repo1 c:\projects\repos\repo2 c:\projects\repos\repo3

on linux can utilize bash script

find ~/projects/repos/ -type d -name .git \ | xargs -n 1 dirname \ | sort \ | while read line; echo $line && cd $line && git pull origin $1 && echo ; done

windows batch solution:

if want utilize in .bat script utilize this:

for /d %%g in ("*") (echo %%g) && (cd %%g) && (git pull origin) && (cd ..)

if it's in console:

for /d %g in ("*") (echo %g) && (cd %g) && (git pull origin) && (cd ..)

windows git command-prompt

No comments:

Post a Comment