This commit is contained in:
parent
c804100311
commit
ed67cd5835
26
docs/cmnds/git.md
Normal file
26
docs/cmnds/git.md
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
### 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
|
||||||
|
```
|
Loading…
x
Reference in New Issue
Block a user