title: GIT: Have current commit hash and latest tag in file on commit
body: <p>that's more of a know-how questions probably:</p>
  
  <p>I'm versioning with git and send files for a PHP CMS to the test or production site using rsync. Now I'd like to keep track on what commit is currently deployed using a fool-proof and automated system, I was thinking about this:</p>
  
  <p>Set up a git hook to add/update a text file with the latest tag and commit hash. Then I can easily look up the commit.</p>
  
  <p>My problem is that at the time of pre-commit the script won't know the commit hash. Is there any straight-forward method to get that done (or another approach that comes to the same ends)?</p>
  
  <p>Thanks for your input in advance! </p>