Skip to content

Instantly share code, notes, and snippets.

@jguadagno
Created March 9, 2020 18:56
Show Gist options
  • Save jguadagno/719e5ef11f15951f3d1eb3c399ceebf5 to your computer and use it in GitHub Desktop.
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
@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