• github, pulling multiple

    From Android8675@VERT/SHODAN to all on Thu Aug 10 06:53:00 2017
    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)
  • From poindexter FORTRAN@VERT/REALITY to Android8675 on Thu Aug 10 09:58:00 2017
    Re: github, pulling multiple sub directories
    By: Android8675 to all on Thu Aug 10 2017 10:53 am

    I only recently learned about the DOS "FOR" command which apparently has been around since DOS v5'ish (who knew? Not I!)

    The Fidonet BATPOWER echo used to be a great place for tips and tricks for DOS and 4DOS; I picked up two books that I swore by in the 80s again - Running MS-DOS and Superchaging MS-DOS, by Van Wolverton, published by Microsoft Press. They were indispensible references when I was writing batch files at work and helped back in the BBS day when I was running everything with a batch file, mailer and using errorlevel exits to run events.

    ---
    þ Synchronet þ realitycheckBBS -- http://realitycheckBBS.org