Git get file list in prepare-commit-msg hook

314 Views Asked by At

I want to write a hook that prepares a commit message based on the paths of the changed files. Is it possible to get such a file list at that stage?

I checked the githooks manual entry, but it is kinda sparse.

1

There are 1 best solutions below

0
xeruf On

Use git diff --cached --name-only -r in the script