update-20260401-163742-19979
This commit is contained in:
27
push.sh
Executable file
27
push.sh
Executable file
@@ -0,0 +1,27 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
BRANCH="main"
|
||||
|
||||
# Stop if not inside a git repo
|
||||
git rev-parse --is-inside-work-tree >/dev/null 2>&1 || {
|
||||
echo "Not inside a git repository."
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Check if there are changes
|
||||
if [ -z "$(git status --porcelain)" ]; then
|
||||
echo "No changes to commit."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Random commit message
|
||||
MSG="update-$(date +%Y%m%d-%H%M%S)-$RANDOM"
|
||||
|
||||
echo "Using commit message: $MSG"
|
||||
|
||||
git add .
|
||||
git commit -m "$MSG"
|
||||
git push origin "$BRANCH"
|
||||
|
||||
echo "Done."
|
||||
Reference in New Issue
Block a user