Here is an example of the content of a commit (anonymized ;) ) that you could get using git cat-file -p da500aa4f54cbf8f3eb47a1dc2c136715c9197b9
(replace with the sha1 of one of your commits):
tree 48038c4d189536a0862a2c20ed832dc34bd1c8b2
parent f0bb5942f47193d153a205dc089cbbf38299dd1a
author Firstname Lastname <my@mail.com> 1513256382 +0100
committer Firstname Lastname <my@mail.com> 1515152927 +0100
This is a commit message
If one of these data changes, all the sha1 changes:
The tree
is the sha1 calculated from the content of the files and directories contents.
Parent
is the parent commit hash.
Notice that there is also dates inside, so if you do exactly the same commit but at different moment, the sha1 will change also
PS: You could continue with the command git cat-file -p
to continue explore the tree
and better understand the way git store data.