0

如果我强制推送比 head 更早的提交,它会起作用。如果我然后尝试推头,我被告知一切都是最新的。为什么?这是一般的 git 问题,还是 heroku 独有的问题?第二个命令实际上是

# 这工作,正如预期的那样
git push heroku 开发:master
...

# 那么,这不起作用,正如预期的那样
git push heroku 开发:master
一切都是最新的

# 然后,推送一个较旧的提交,正如预期的那样
git push heroku a1b2c3d4:master
...

# 那么,这失败了。为什么?!:-(
git push heroku 开发:master
一切都是最新的

4

1 回答 1

0

您是否曾经将旧提交推送到 Heroku?我认为您没有,因为 Heroku 可能会确定提交 id 是否已收到版本。这个假设可以通过以下步骤来验证:

1. git push heroku develop:master => our starting point
2. Change and commit => Rev A
3. Change and commit => Rev B
4. git push heroku develop:master => Rev B known to Heroku
5. Change and commit => Rev C
6. git push heroku develop:master => Rev C known to Heroku
7. git push heroku Rev A:master => this should work as unknown to Heroku
8. git push heroku Rev B:master => this should not work as known to Heroku
9. git push heroku develop:master => we know this doesn't work

无论如何,您可以使用https://devcenter.heroku.com/articles/releases#listing-release-historyhttps://devcenter.heroku.com/articles/releases#rollback来回滚动

于 2012-12-05T13:53:53.030 回答