Skip to content

Instantly share code, notes, and snippets.

@aaossa
Created March 27, 2016 04:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aaossa/5c8cc074989a27f0a70b to your computer and use it in GitHub Desktop.
Save aaossa/5c8cc074989a27f0a70b to your computer and use it in GitHub Desktop.
Batch utilities

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
@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
@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
{
"cmd": "$file",
"working_dir": "$project_path",
"windows" : {
"shell": true
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment