Created
March 9, 2020 18:56
-
-
Save jguadagno/719e5ef11f15951f3d1eb3c399ceebf5 to your computer and use it in GitHub Desktop.
Windows Batch file for git staging, committing, pushing, and tagging. Used for Presentations
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 Argument 1=%1 | |
:: echo Argument 2=%2 | |
if "%1"=="" GOTO MissingArg1 | |
SET commitMessage=%1 | |
if "%2"=="" (SET commitTag=%commitMessage%) else (SET commitTag=%2) | |
:: echo CommitMessage=%commitMessage% | |
:: echo CommitTag=%commitTag% | |
:: exit | |
git add . | |
git commit -m %commitMessage% | |
git push origin master | |
git tag %commitTag% | |
exit 0 | |
:MissingArg1 | |
echo syntax: gittag 'message' 'tag' | |
echo tag is optional | |
exit 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment