Skip to content

Instantly share code, notes, and snippets.

@aaossa
Created March 27, 2016 04:17
Show Gist options
  • Save aaossa/5c8cc074989a27f0a70b to your computer and use it in GitHub Desktop.
Save aaossa/5c8cc074989a27f0a70b to your computer and use it in GitHub Desktop.

Revisions

  1. aaossa created this gist Mar 27, 2016.
    16 changes: 16 additions & 0 deletions AutoPull.bat
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,16 @@
    @ECHO OFF

    REM This bat file iterates on the folders in this directory and
    REM makes a "git pull" over every folder (only "git repos")

    FOR /f "delims=" %%D IN ('dir /a:d-h /b') DO (
    CD %%~D
    IF EXIST ".git" (
    ECHO Repo: %%D
    git pull
    ECHO.
    )
    CD ..
    )

    PAUSE
    18 changes: 18 additions & 0 deletions AutoPush.bat
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,18 @@
    @ECHO OFF

    REM This bat file push changes to your remote repo
    REM Ignores itself

    ECHO Automatic git add (-A), commit and push
    ECHO.

    SET /p commitMessage="Commit message: "
    ECHO.

    git add -A
    git reset -- AutoPush.bat
    git commit -m "%commitMessage%"
    git push

    ECHO.
    PAUSE
    5 changes: 5 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    # Batch utilities (Windows)

    * `AutoPull.bat`: Execute `git pull` inside every git subfolder of the current folder
    * `AutoPush.bat`: Execute `git add -a`, `git commit -m MESSAGE` and `git push` in the current folder
    * `batch.sublime-build`: Simple batch Sublime Text 3 build system
    7 changes: 7 additions & 0 deletions batch.sublime-build
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    {
    "cmd": "$file",
    "working_dir": "$project_path",
    "windows" : {
    "shell": true
    }
    }