Subj : github, pulling multiple sub directories
To   : all
From : Android8675
Date : Thu Aug 10 2017 10:53 am

So I'm goofing on my board updating some git repositories (running git pull),
and was thinking... Gotta be a .bat file for this (I'm sure the bash folks got
this covered, but Windows folk might find a use for it.)

I only recently learned about the DOS "FOR" command which apparently has been
around since DOS v5'ish (who knew? Not I!), so I finally broke down the command
and figured out how it works then came up with a quick .bat file that scans all
subfolders from where you call the .bat file, looks for the .git folder of a
repository and runs "git pull".

Got a bunch of repositories in a subfolder, just call this .bat and get all
your git repos updated.

Prereq: Gotta be able to call "git" from dos/cmd prompt.
Disclaim: Don't nuke your HD accidentally, please.

--start--
@echo off
set oldcd=%CD%
echo Scanning sub-folders off %oldcd% for .git projects and pulling...
for /d /r . %%d IN (.git) do @if exist "%%d" (echo Pulling @ %%~fd... && git -C
%%~fd\.. pull)
cd %oldcd%
--end--

---
� Synchronet � Shodan's Core @ ShodansCore.com (Port 2323 for Nethack)