Created
August 25, 2022 19:50
-
-
Save helderberto/319cee17ff4db5caf5b7d11255be9f07 to your computer and use it in GitHub Desktop.
Git Sync
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
#!/usr/bin/env bash | |
org_head=$(git rev-parse HEAD) | |
printf "Deploying updates to GitHub...\033[0m\n" | |
printf "\033[0;32mDeploying commit $org_head of '🔒 vaults' \n\033[0m" | |
## Commit and push | |
if [[ `git status --porcelain` ]]; then | |
git add . | |
git commit -m "Automatic sync: $(date) | |
This is a commit of '$org_head' | |
Respository: github.com/helderberto/<REPOSITORY_NAME>" | |
git pull --rebase | |
else | |
printf "No changes detected.\n" | |
fi | |
git push origin main |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment