How does git show the pre-commit hook a different index? How does git show the pre-commit hook a different index? unix unix

How does git show the pre-commit hook a different index?


The git commit -a will modify the index, and can be rejected. It seems to me that before the command completes, its not-yet-validated index modifications can't be shown to any other executing command. My first try at convincing git you're running as part of the hook and not as part of some other executing command would be to export every variable starting with GIT_ (export ${!GIT_*}).