wiki/docs/cmnds/git.md
sthope 3db505cfa4
All checks were successful
continuous-integration/drone/push Build is passing
git
2022-07-24 01:00:17 +02:00

26 lines
404 B
Markdown

### (my) git push script
```
#!/bin/sh
# If a command fails then the deploy stops
set -e
# Confirm with user
read -n 1 -p "Push to GitHub? (enter or ctrl+c):" input
printf "\033[0;32mDeploying updates to GitHub...\033[0m\n"
# Add changes to git
git add .
# Commit changes
msg="rebuilding site $(date)"
if [ -n "$*" ]; then
msg="$*"
fi
git commit -m "$msg"
# Push source
git push origin master
```