2012-10-17 74 views
1

我用以下三個命令來推動改變一個已經存在的應用程序,但所做的更改不會被反射推送到heroku,但沒有更改應用程序?

$ git add . 
$ git commit -m "changes" 
# On branch master 
# Your branch is ahead of 'origin/master' by 2 commits. 
$ git push heroku master 

我也得到:

To [email protected]:sleepy-oasis-7771.git ! [rejected]  master -> master (non-fast-forward) 
error: failed to push some refs to '[email protected]:sleepy-oasis-7771.git' 
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. 

,並沒有更改反映在應用程序

+0

請檢查以下內容:http://stackoverflow.com/questions/9831129/failed-to-push-some-refs-to-githeroku-commyapp-git –

回答

2

您的推送是! [rejected]。這就是爲什麼沒有改變會生效。

由於消息表示:

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. 

這是指你進一步的文件,可見你的本地計算機或online上。同樣,如消息所示,git pull(及其產生的合併)將解決此問題。

避免此問題的一種方法是使用rebase workflow而不是合併工作流程。在功能分支中進行開發,當您準備合併時,拉出主服務器,重新綁定功能分支,重新運行測試套件,然後合併。

此外,請閱讀您的錯誤消息。

相關問題