How to view remote Git revision on Heroku

Jesper Rønn-Jensen picture Jesper Rønn-Jensen · Feb 17, 2010 · Viewed 57.6k times · Source

For deploying to Heroku, I use git push heroku master. But how do I see which revision I pushed up to heroku? (I'm often in doubt if I pushed the recent version up)

For those not familiar with it, Heroku's create script generates a remote git repository that you push to. Upon push, the code is deployed magically.

Heroku adds a remote repository to the local one in the form:

$ git remote add heroku [email protected]:appname.git

More info in Heroku's manual "Deploying with Git"

Question is: How can I see latest version in Heroku repository?

Answer

dolzenko picture dolzenko · Nov 7, 2011

The correct answer is actually so simple. You don't need to checkout anything, neither do you have to resort to COMMIT_HASH hacks (which don't work on Cedar stack). All you need to do is: git ls-remote <remote>

 > git ls-remote heroku
ddaszxcewb585d3a3c00de816a197b14462791a3        HEAD
ddaszxcewb585d3a3c00de816a197b14462791a3        refs/heads/master