From 215cc47cc3ad5c2bfeefe8f6b2a0acccb35a47a1 Mon Sep 17 00:00:00 2001 From: ben Date: Mon, 17 Aug 2026 10:09:39 +0200 Subject: [PATCH] kaas --- git-helper | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) mode change 100644 => 100755 git-helper diff --git a/git-helper b/git-helper old mode 100644 new mode 100755 index 1a9efad..02022da --- a/git-helper +++ b/git-helper @@ -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" \ No newline at end of file