Usually, the whole index is committed as an indivisible unit. The trick of git commit <filename> is that it avoids using the index completely. It goes straight from work-tree (file) to repository (blob), as far as I can understand. From the docs of git commit <http://git-scm.com/docs/git-commit> :
3. by listing files as arguments to the commit command, in which case the commit will ignore changes staged in the index, and instead record the current content of the listed files (which must already be known to git); I'm not sure if there is a way to achieve what you want without writing some C, and create a temporary index on the fly or something.. By the way, you may find this chapter of the Git book interesting: http://git-scm.com/book/en/Git-Internals-Git-Objects - some details on plumbing there. -- You received this message because you are subscribed to the Google Groups "Git for human beings" group. To view this discussion on the web visit https://groups.google.com/d/msg/git-users/-/yeD34G4cX2MJ. To post to this group, send email to firstname.lastname@example.org. To unsubscribe from this group, send email to git-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/git-users?hl=en.