I do not think you can; when you deploy your application to Heroku using git push , it seems to put it in the repository and then do a clean code check without the git repository. You can pop with the heroku run bash command and see what is there. Here is what is there for one of my applications:
$ heroku run bash Running `bash` attached to terminal... up, run.1 ~ $ ls -a . bin config.ru Gemfile lib public .rspec TODO.txt .. .bundle db Gemfile.lock Procfile Rakefile script vendor app config doc .gitignore .profile.d README spec
No .git , so git commands will not work.
If you just want to see which version is currently deployed, you can see it from the Heroku toolbar for your application on the Activity tab. ( https://dashboard.heroku.com/apps/[your app name]/activity ) But I'm not sure how to get the git version in the application code so that you can display it as part of your application.
source share