GitScrum / Docs

Intégration Git

Intégration Git avec GitScrum CLI. Détection automatique de branches, messages de commit et hooks Git.

Connectez votre workflow Git à GitScrum.


Convention de Branches

Nommez vos branches avec l'ID de tâche :

git checkout -b feature/GS-123-nouvelle-fonctionnalite

Le CLI détecte automatiquement GS-123 et l'associe à la tâche.


Détection Automatique

# Crée une tâche et une branche
gitscrum tasks add --title "Nouvelle feature" --branch

# Le timer est auto-assigné à la tâche de la branche courante
gitscrum timer start

Messages de Commit

Incluez les IDs de tâches :

git commit -m "feat: ajout authentification [GS-123]"

Hooks Git

Prepare-commit-msg

Ajoute automatiquement l'ID de tâche :

#!/bin/bash
BRANCH=$(git branch --show-current)
TASK_ID=$(echo "$BRANCH" | grep -oE 'GS-[0-9]+' | head -1)
if [ -n "$TASK_ID" ]; then
  echo "[$TASK_ID] $(cat $1)" > $1
fi

Post-commit

Met à jour le statut de la tâche :

#!/bin/bash
TASK_ID=$(git log -1 --format=%s | grep -oE 'GS-[0-9]+')
if [ -n "$TASK_ID" ]; then
  gitscrum task update $TASK_ID --status in-progress
fi

Configuration Hooks

gitscrum hooks install