14 lines
449 B
Bash
14 lines
449 B
Bash
#!/bin/sh
|
|
#
|
|
# Pre-commit hook que verifica si hay cambios sin agregar al staging area.
|
|
# Si se encuentran cambios sin agregar, el commit se aborta.
|
|
|
|
# Revisa si hay archivos modificados pero no agregados (unstaged)
|
|
if ! git diff-index --quiet HEAD --; then
|
|
echo "Error: Hay cambios sin agregar al commit."
|
|
echo "Por favor, agrega todos los archivos relevantes con 'git add .' o 'git add <file>' antes de hacer commit."
|
|
exit 1
|
|
fi
|
|
|
|
exit 0
|