I am curious about git add action, so I do some test.
create a index
1. git init
2. mkdir mydir
3. echo "hello" > mydir/hello
4. find .git/objects ==> nothing
5. git add .
6. find .git/objects ==> only find one file ,by cat-file, I am sure it is hello
do some change
7. rm mydir/hello
get the file back
8. git checkout mydir/hello
9. ls mydir/hello ==> hello is back
My doubt is:
when I do 'git add .'
,there create only one blob, and not create a tree to record the direcoty 'mydir'. So,how could git checkout mydir/hello
can find the blob ?