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 <>

        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

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: - 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
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at

Reply via email to