kaas
This commit is contained in:
Regular → Executable
+15
-10
@@ -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 "$COMMITMSG"
|
||||
|
||||
git push
|
||||
|
||||
cd ~
|
||||
git commit -m "$msg"
|
||||
echo "Committed with message: $msg"
|
||||
Reference in New Issue
Block a user