From this post, the hash of a file in Git is computed
Commit Hash (SHA1) = SHA1("blob " + <size_of_file> + "\0" + <contents_of_file>)
I tested it myself for two empty files to check whether it was correct:
100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0 empty1.txt
100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0 empty2.txt
But why does Git exclude the name of the file from the hash? How does it distinguish between empty1.txt and empty2.txt?
If I were to change the name of empty1.txt to empty2.txt, how does Git keep track of that change when I call git status?