我目前的分支是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