Skip to content

Instantly share code, notes, and snippets.

@mahi008
Forked from ethaizone/git_autocommit_all.bat
Created September 25, 2019 13:34
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 mahi008/a282b99aa7eaab878f85dfa07fc7e808 to your computer and use it in GitHub Desktop.
Save mahi008/a282b99aa7eaab878f85dfa07fc7e808 to your computer and use it in GitHub Desktop.
Commit git with bat file
@echo off
echo type "commit" or "update"
cd "curl"
set GIT_PATH="C:\Program Files (x86)\Git\bin\git.exe"
set BRANCH = "origin"
:P
set ACTION=
set /P ACTION=Action: %=%
if "%ACTION%"=="c" (
%GIT_PATH% add -A
%GIT_PATH% commit -am "Auto-committed on %date%"
%GIT_PATH% pull %BRANCH%
%GIT_PATH% push %BRANCH%
)
if "%ACTION%"=="u" (
%GIT_PATH% pull %BRANCH%
)
if "%ACTION%"=="exit" exit /b
goto P
@echo off
echo type "commit" or "update"
cd "curl"
set TGIT_PATH="C:\Program Files\TortoiseGit\bin\TortoiseGitProc.exe"
:P
set ACTION=
set /P ACTION=Action: %=%
if "%ACTION%"=="c" (
%TGIT_PATH% /command:commit /logmsg:"Auto-committed on %date%" /closeonend:3
%TGIT_PATH% /command:pull /closeonend:3
%TGIT_PATH% /command:push /closeonend:3
)
if "%ACTION%"=="u" (
%TGIT_PATH% /command:pull /closeonend:3
)
if "%ACTION%"=="exit" exit /b
goto P
@echo off
echo type "commit" or "update"
cd "curl"
set GIT_PATH="C:\Program Files (x86)\Git\bin\git.exe"
set TGIT_PATH="C:\Program Files\TortoiseGit\bin\TortoiseGitProc.exe"
set BRANCH = "origin"
:P
set ACTION=
set /P ACTION=Action: %=%
if "%ACTION%"=="c" (
%TGIT_PATH% /command:commit /logmsg:"Auto-committed on %date%" /closeonend:3
%GIT_PATH% pull %BRANCH%
%GIT_PATH% push %BRANCH%
)
if "%ACTION%"=="u" (
%GIT_PATH% pull %BRANCH%
)
if "%ACTION%"=="exit" exit /b
goto P
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment