stefanuddenberg
12/29/2018 - 9:45 AM

Automatic Git Add/Commit/Push

For use on Windows 10 machines with autogit command. Will only work once both scripts are in your PATH.

#!/bin/sh
###########################
# switch to branch you want to use
git checkout master
# add all added/modified files
echo Adding files...
git add .
# commit changes
echo Please enter commit message:
read commitMessage
git commit -am "$commitMessage"
# push to git remote repository
echo Pushing to remote repository...
git push
###########################
echo Done, press Enter...
read