Skip to content

Instantly share code, notes, and snippets.

@HusseinLezzaik
Created January 28, 2023 02:27
Show Gist options
  • Save HusseinLezzaik/5c149cd1694fa6f7dddbb0cecff15498 to your computer and use it in GitHub Desktop.
Save HusseinLezzaik/5c149cd1694fa6f7dddbb0cecff15498 to your computer and use it in GitHub Desktop.
Bash script to automatically commit and push local changes
#!/bin/bash
gstatus=`git status --porcelain`
if [ ${#gstatus} -ne 0 ]
then
git add --all
git commit -m "Automated sync: $gstatus"
git pull --rebase
git push
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment