我想推送之前的版本代码到仓库。如何在Heroku上推送以前的变更集?
类似于:
git push heroku 07226c49428354b09349ec45078122ce7cd410c8
谢谢!
编辑:一些尝试
执行 git branch -a 命令会产生:
master
remotes/heroku/master
remotes/origin/HEAD -> origin/master
remotes/origin/master
尝试类似以下的操作:
git push heroku 07226c49428354b09349ec45078122ce7cd410c8:master
请给我:
To prevent you from losing history, non-fast-forward updates were rejected
Merge the remote changes (e.g. 'git pull') before pushing again. See the
'Note about fast-forwards' section of 'git push --help' for details.
我猜测这是因为我的当前Heroku部署是HEAD,而我想要部署以前的某个修改集时,Git会报错。所以我重新创建了一个新的Heroku stack(删除当前的Heroku、删除其引用,并创建一个新的Heroku Cedar Stack),然后再次尝试推送特定的修改集。这次,在一个空的Heroku部署上,我得到了如下提示:
有没有任何想法可以在没有这些问题的情况下推送不同的修改集呢?或者我必须每次从特定的修改集开始创建分支,重新创建Heroku stack并推送该分支?错误: 无法推送到未经限定的目标: master 目标refspec既不匹配远程存在的ref,也不以refs/开头,我们无法根据源ref猜测出前缀。 错误: 推送一些refs失败到 'git@heroku.com:empty-waterfall-8460.git'
git branch -a
命令的输出。 - Matthew Flaschen