An easy methodology of “stamping” your commits would be to create an environment varible to store the return value of:
git describe –always
This should by default always return the most recent tagged release or branch name.
You can store this variable in the environment.rb file of your project by appending this line of code:
git describe --always unless defined? APP_VERSION
This was originally retrieved from this fine human being Daniel Pietzsch