git push origin <remote/branch>
给了我
To github.com:<remote/branch>
! [rejected] feature/branch001-> feature/branch001 (non-fast-forward)
error: failed to push some refs to 'git@github.com:<remote/branch>'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
然而当我git pull origin <remote/branch>
时,我得到了
Merge made by the 'recursive' strategy.
在推送到github之后,这个合并提交根本没有显示更改的代码 - +0 −0
为什么git会拒绝推送?
答案 0 :(得分:0)
仅尝试git pull
。看,如果行得通。
注意:如果您已经命名了来源,则只需运行git pull
而无需命名来源。如果您在分支机构,则可能必须输入git pull origin branchname
。