我目前的分支是my_branch
。試圖推動修改到遠程回購我得到:在爲什麼「git push」被拒絕? (「git pull」沒有幫助)
$ git push
Counting objects: 544, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (465/465), done.
Writing objects: 100% (533/533), 2.04 MiB | 1.16 MiB/s, done.
Total 533 (delta 407), reused 0 (delta 0)
To [email protected]
4ed90a6..52673f3 my_branch -> my_branch
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to '[email protected]'
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
結果:
$ git pull
Already up-to-date.
爲什麼我得到這個錯誤? 我該如何解決此問題併成功執行git push
?
如果你只是想推動「my_branch」:混帳推起源my_branch。 – ysdx 2012-01-17 22:24:11
只是爲了澄清接受的答案一些:'4ed90a6..52673f3 my_branch - > my_branch'表明'my_branch'已成功更新,但'! [被拒絕]主 - >主(非快進)'表示主分支失敗。這意味着* some refs *沒有被推送到存儲庫,但其他一些*可能已經通過了,比如'my_branch'。 – 2012-01-18 01:12:09