Skip to main content

git-worktree-precommit-hook-flutter-failure

Fix git pre-commit hook failures in Flutter projects when using git worktrees. Use when: (1) Pre-commit hook with `flutter analyze` fails during `git commit` but passes when run manually, (2) Hook output shows "Resolving dependencies..." then immediately fails with no actual analysis errors, (3) Working in a git worktree (created via `git worktree add`). Root cause: git sets GIT_DIR to a worktree-style path during hook execution, which breaks `flutter pub get` (called internally by `flutter analyze`). Fix: unset GIT_DIR, GIT_INDEX_FILE, and GIT_WORK_TREE before flutter/dart commands in the hook.

Ir a la instalación

Datos de origen

Repositorio
divinevideo/divine-mobile
Última actividad en el origen
7 de agosto de 2026 a las 14:43
Idioma detectado de SKILL.md
inglés
Estrellas
262
Forks
52

Opciones de instalación

De forma predeterminada está seleccionado el prompt que primero revisa el origen. Puedes cambiar a un comando directo o descargar una copia local.

Revisa los archivos de origen

Lee SKILL.md y los archivos complementarios que muestra SkillsMP antes de decidir si quieres instalarlo.