I have an app that is deployed to Heroku, and presume that I haven't done the deployment, how can I check which branch was used to deploy to heroku, or what is the commit ID (as with it I can determine the branch if needed)?
I am using GitHub.
So far I have tried to run in console:
$ heroku releases
and then running the:
$ heroku releases:info v123
But it didn't show anything.
How can I determine the commit or branch name from the deployed app on heroku?
It is a Rails app (maybe it might help to determine this information)
To see what's been deployed on the Heroku dashboard: Just click the Overview tab. You'll see an Activity view on the right that shows recent deployments with commit hashes.
Heroku manages most app deployments with Git, the popular version control system.
Just go to https://dashboard.heroku.com/apps/YOUR_APP_NAME/deploy/heroku-git. If you haven't already, log in to your Heroku account and follow the prompts to create a new SSH public key. Use Git to clone YOUR_APP_NAME's source code to your local machine.
To deploy your app to Heroku, use the git push command to push the code from your local repository's main branch to your heroku remote. For example: $ git push heroku main Initializing repository, done.
The "releases" feature does not help you because it's an internal counter Heroku is using to keep track of pushes and re-configuration.
If you re-configure your app, the counter will increase. Deployments will also increase the counter but that doesn't help you.
But remember that Heroku is just another "git remote." So if you are on the machine which you used to deploy, there must be this:
$ git remote show heroku
* remote heroku
Fetch URL: https://git.heroku.com/your-app-3367.git
Push URL: https://git.heroku.com/your-app-3367.git
HEAD branch: master
Remote branch:
master tracked
Local ref configured for 'git push':
master pushes to master (up to date)
If you have a similar output, you can just:
git show heroku/master
and see the commit that was pushed and deployed most recently.
To see what's been deployed on the Heroku dashboard: Just click the Overview tab. You'll see an Activity view on the right that shows recent deployments with commit hashes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With