Files
gartenmanager/.claude/scripts/new-feature.sh
Faultier314 6af5df32f6 chore: add Claude tooling and optimize token efficiency
- .claude/scripts/bump.sh: one-command version bump + commit + push
- .claude/scripts/new-feature.sh: branch creation helper
- .claude/session-context.md: session start context
- CLAUDE.md: reduced to dispatch table, no rule duplication
- docs/project-structure.md: restructured as dense module reference

Version: 0.2.1
2026-04-05 22:32:58 +02:00

42 lines
1.1 KiB
Bash
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env bash
# new-feature.sh Feature- oder Fix-Branch aus develop erstellen und pushen
#
# Verwendung:
# bash .claude/scripts/new-feature.sh feature <name>
# bash .claude/scripts/new-feature.sh fix <name>
# bash .claude/scripts/new-feature.sh debug <name>
set -euo pipefail
TYPE="${1:-}"
NAME="${2:-}"
if [[ -z "$TYPE" || -z "$NAME" ]]; then
echo "Verwendung: bash .claude/scripts/new-feature.sh [feature|fix|debug] <name>"
exit 1
fi
case "$TYPE" in
feature|fix|debug) ;;
*)
echo "Fehler: Ungültiger Typ '$TYPE'. Erlaubt: feature, fix, debug"
exit 1
;;
esac
BRANCH="$TYPE/$NAME"
ROOT="$(git rev-parse --show-toplevel)"
# Sicherstellen dass develop aktuell ist
echo "Wechsle zu develop und aktualisiere..."
git -C "$ROOT" checkout develop
git -C "$ROOT" pull origin develop
# Branch erstellen und pushen
echo "Erstelle Branch: $BRANCH"
git -C "$ROOT" checkout -b "$BRANCH"
git -C "$ROOT" push -u origin "$BRANCH"
echo "Fertig: Branch '$BRANCH' erstellt und gepusht."
echo "Aktiver Branch: $(git -C "$ROOT" branch --show-current)"