Created
January 18, 2016 15:38
-
-
Save thinkingmedia/f6c6d00238d58c1e025b to your computer and use it in GitHub Desktop.
Type `gitty` in a Windows prompt to add, commit and push with one command.
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 | |
git status | |
IF %ERRORLEVEL% NEQ 0 (EXIT /B -1) | |
git add --all | |
IF %ERRORLEVEL% NEQ 0 (EXIT /B -1) | |
IF "%~1"=="" GOTO END_BATCH | |
git commit -m %1 | |
IF %ERRORLEVEL% NEQ 0 (GOTO END_BATCH) | |
FOR /f %%i IN ('git config --local remote.origin.url') DO SET URL=%%i | |
IF x%URL:thinkingmedia=%==x%URL% GOTO PUSH_CHANGES | |
SET /P AREYOUSURE=Push changes (Y/[N])? | |
IF /I "%AREYOUSURE%" NEQ "Y" GOTO END_BATCH | |
:PUSH_CHANGES | |
git push | |
:END_BATCH |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There is the option to check if the remote URL contains my username. If it does it prompts if the changes should be pushed. This is handy if you want to control when you push changes for a specific account.