在Heroku上克隆以前的版本 [英] Cloning a previous version on Heroku
问题描述
我是Heroku的新手。将错误代码推送到服务器后,我使用了 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 git@heroku.com:<project>.git <dir>
不幸的是,这会克隆损坏的磁头,而不是回滚。有没有办法真正克隆特定的先前版本?
Unfortunately, this clones the corrupted head, not the rollback. Is there a way to actually clone a specific previous version?
推荐答案
进行回滚时,Heroku Git存储库的头部将不再反映您应用的运行状态。检查您的发布:
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 shanley@heroku.com 5 minutes ago
v51 Deploy de63889 kendra@heroku.com 7 minutes ago
v50 Deploy 7c35f77 katie@heroku.com 3 hours ago
de63889
值是Git commit shas。有了这些,您可以在本地检查该提交:
The de63889
values are Git commit shas. With those, you can check out that commit locally:
git checkout de63889
这篇关于在Heroku上克隆以前的版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!