I added a file to the index with:
git add somefile.txt
I then got the SHA1 for this file with:
git hash-object somefile.txt
Commit the file and note the sha1 hash of the commit object. After that use
git ls-tree
and you will get the names of the files with the hashes.
Check the manual pages for more options.