Created
October 18, 2013 06:58
-
-
Save ethaizone/7037514 to your computer and use it in GitHub Desktop.
Commit git with bat file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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 |
Worked fine, thank you bro'
Hello
how we can run git command from cmd.exe?
If you install git windows version from https://git-scm.com/downloads, it should have git command included already.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello
how we can run git command from cmd.exe?