Created
January 31, 2021 12:39
-
-
Save yigitozgumus/6666ac009b9636bd0a08759667a9b119 to your computer and use it in GitHub Desktop.
This script updates the repo if any change is performed
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
#!/bin/sh | |
CHANGES_EXIST="$(git status --porcelain | wc -l)" | |
if [ "$CHANGES_EXIST" -eq 0 ]; then | |
exit 0 | |
fi | |
git stash | |
git pull | |
git stash pop | |
git add . | |
git commit -q -m "Last Sync: $(date "+%d-%m-%Y %H:%M:%S")" | |
git push -q |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment