2012-03-22 33 views
1

我收到這個錯誤,當我想推我的文件到heroku代表。 香港專業教育學院嘗試以下解決方案,但沒有幫助:未能推動一些裁判[email protected]:myapp.git

  1. this
  2. 嘗試git pull heroku master(以下結果)
  3. 試圖努力git push heroku -f(以下結果)
  4. 集autocrlf =假

請指導我通過這個。

謝謝

C:\myapp>git init 
Reinitialized existing Git repository in C:/myapp/.git/ 
C:\myapp>git add . 
C:\myapp>git add -u 

C:\myapp>git commit -m "ic" 
# On branch master 
nothing to commit (working directory clean) 

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

試圖git pull heroku master

warning: no common commits 
remote: Counting objects: 215, done. 
remote: Compressing objects: 100% (147/147), done. 
remote: Total 215 (delta 82), reused 132 (delta 62)Receiving objects: 79% (170/ 

Receiving objects: 100% (215/215), 1.49 MiB | 107 KiB/s, done. 
Resolving deltas: 100% (82/82), done. 
From heroku.com:myapp 
* branch   master  -> FETCH_HEAD 
Auto-merging start.php 
CONFLICT (add/add): Merge conflict in start.php 
Auto-merging src/appinfo.txt 
CONFLICT (add/add): Merge conflict in src/appinfo.txt 
Auto-merging result.php 
CONFLICT (add/add): Merge conflict in result.php 
Auto-merging landhere.php 
CONFLICT (add/add): Merge conflict in landhere.php 
Automatic merge failed; fix conflicts and then commit the result. 

試圖git push heroku -f

F:\myapp>git remote add heroku [email protected]:myapp.git 
F:\myapp>git push heroku -f 

Counting objects: 41, done. 
Delta compression using up to 4 threads. 
Compressing objects: 100% (40/40), done. 
Writing objects: 100% (41/41), 1.36 MiB | 12 KiB/s, done. 
Total 41 (delta 0), reused 0 (delta 0) 

-----> Heroku receiving push 
!  Heroku push rejected, no Cedar-supported app detected 

To [email protected]:myapp.git 
! [remote rejected] master -> master (pre-receive hook declined) 
error: failed to push some refs to '[email protected]:myapp.git' 
+0

你說「雖然嘗試'git push heroku -f'」但粘貼的命令行不顯示'-f' ... – 2012-03-22 23:56:32

+0

@Kristian Glass:對不起,我錯誤地複製了錯誤的命令,我現在更新了我的問題。 – Maven 2012-03-23 09:32:11

+0

你解決了衝突嗎? – 2012-03-23 10:24:34

回答

6

你似乎確實已經與上游合併衝突。我建議如下:

運行git fetch origin

2.運行git log ..origin/master,看看有什麼在原新,你還沒有。注意'git push -f'將會覆蓋這些提交,如果你嘗試它...

3.運行git pull --rebase(這可能會再次失敗,合併衝突)。在成功拉動和重建之後,你的推動應該起作用。我會,不過,密切關注這些合併衝突,因爲它似乎在你的情況下,他們從歷史亂碼幹(可能是先前的合併/重訂,出了錯?)

4.如果一切都失敗,創建新分支,指向原點/主點(git checkout -b new_master origin/master),然後使用git-loggit-cherry-pick - 剔除與原點/主點相關的唯一提交的新提交。然後推入這個新分支並歸檔舊的主分支。

假設上述四種方式都失敗了,遠程存儲庫可能會出現問題。

相關問題