2012-04-09 58 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