I am trying to run a batch file,
which will go to grandparent folder, and do git pull for all its child repository directories. For some reason, this is not working. How can I get this functioning?
@ECHO OFF
setlocal
SET parent=%~dp0
ECHO parent=%parent%
FOR %%a IN ("%parent:~0,-1%") DO SET grandparent=%%~dpa
ECHO grandparent=%grandparent%
ECHO %grandparent%
FOR /D %%G in (%grandparent%) Do cd %%G & call git pull & cd ..
TIMEOUT 10
Using following as reference:
How to git pull for multiple repos on windows?
Using Windows 10