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
Great one-liner to do this:
git rev-list --objects --all | grep