2012-04-09 59 views
4

我想推送我的存储库的以前版本。我如何才能将heroku转换为以前的变更集?Git:将不同的变更集推送到heroku

类似:

git push heroku 07226c49428354b09349ec45078122ce7cd410c8

的感谢!

编辑:有些试验

的Git分支-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堆栈(删除当前的heroku,删除它的引用,并创建一个新的heroku雪松堆栈),并尝试再次推送特定的变更集。这一次,我得到一个空的heroku部署:

error: unable to push to unqualified destination: master The destination refspec neither matches an existing ref on the remote nor begins with refs/, and we are unable to guess a prefix based on the source ref. error: failed to push some refs to '[email protected]:empty-waterfall-8460.git'

任何想法如何推动不同的变更集没有任何这些问题?或者我必须每次都从特定的变更集开始创建分支,重新创建heroku堆栈并推送该分支?

回答

0
git push heroku 07226c49428354b09349ec45078122ce7cd410c8:master 

您可能想要为此提交创建分支或标记,以备将来参考。

编辑:我觉得应该是:

git push -f heroku 07226c49428354b09349ec45078122ce7cd410c8:master 

既解决了第一个错误。我不确定重新创建堆栈后发生了什么。

+0

出于某种原因,我收到以下错误: 目的地refspec既不匹配远程的现有参考也不匹配 以refs /开头,我们无法根据源参考猜测前缀。 错误:未能推动一些裁判'[email protected]:furious-frost-6040.git' 任何想法为什么? – Karan 2012-04-28 19:26:43

+0

@Newton,在你的问题中发布'git branch -a'的输出。 – 2012-04-29 01:28:23

+0

更新了分支输出。 – Karan 2012-04-29 09:08:33