Unexpected behavior with “git commit .” when pre-commit hook modifies staged files
问题 In my experience git commit -a has had equivalent behavior to git commit . However, recently I have created a pre-commit hook that automatically formats my source code and now git commit . has some unexpected side-effects: the file that is committed ends up as modified in the working directory and in the index after the commit command finishes. This doesn't happen with git commit -a . I'm trying to understand what is going on behind the scenes when running git commit . that is causing this to