Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cloning a previous version on Heroku

I'm new to Heroku. After pushing bad code to the server, I used heroku rollback to revert to a previous version. I then tried to clone this rollback to my computer with:

git clone [email protected]:<project>.git <dir>

Unfortunately, this clones the corrupted head, not the rollback. Is there a way to actually clone a specific previous version?

like image 861
nullnullnull Avatar asked Jul 27 '13 23:07

nullnullnull


1 Answers

When you do rollbacks, the head of your Heroku Git repo will no longer reflect the running state of you app. Check your releases:

$ heroku releases
Rel   Change                   By                    When
----  ----------------------   -------------------   -------------
v52   Config add AWS_S3_KEY    [email protected]    5 minutes ago
v51   Deploy de63889           [email protected]     7 minutes ago
v50   Deploy 7c35f77           [email protected]      3 hours ago

The de63889 values are Git commit shas. With those, you can check out that commit locally:

git checkout de63889
like image 99
friism Avatar answered Oct 14 '22 08:10

friism