3 ms·
If you do git add . && git commit -m wip then git first checks which files have changed, taking the shortcut of checking if the files mtime is newer than th
by cerved 3y ago
If you do
git add . && git commit -m wip
then git first checks which files have changed, taking the shortcut of checking if the files mtime is newer than the current index.
This is basically the speed of
find .
For files that are changed it creates new trees and store it in the object store, this is cp + SHA-1
Then it takes all that metadata, comine it to one, add it to a commit message and it's done.
Doesn't take a lot of time to do these things, but it will for very large files.
Going the other direction is fast, reverse lookup all that metadata and copy the contents back into the working directory