Using GIT Commit Hash as a reference in my PHP Dev Environment

I would like to be able to reference the latest commit hash reference in my (PHP) dev / test environment but a little unsure of the way to proceed.

Ideally, I would commit my changes and then in some automated way recover the reference for that commit so that I can publish to the to the top of my page (on the remote server). This would mean that testers know which commit they are currently testing.

I have read about hooks but not entirely sure how that would work or what the flow would be. Has any one done this kind of thing and can anyone suggest a flow, hints or tips?

Thank you in advance.