This commit is contained in:
ben
2026-08-17 10:09:39 +02:00
parent 9c97f2dab7
commit 215cc47cc3
Regular → Executable
+15 -10
View File
@@ -1,13 +1,18 @@
#!/bin/bash #!/usr/bin/env bash
# git-commit-safe - Add all and commit with a message (no push)
set -euo pipefail
cd ~/Desktop/calender || exit msg="${1:-}"
if [[ -z "$msg" ]]; then
echo "Usage: $0 \"commit message\""
exit 2
fi
git add . git add -A
if git diff --cached --quiet; then
echo "No staged changes to commit."
exit 0
fi
read -p "commit msg: " COMMITMSG git commit -m "$msg"
echo "Committed with message: $msg"
git commit -m "$COMMITMSG"
git push
cd ~