我试图将一个回购推到我的github后,从另一台计算机,即使在拉更新后推小的更改后,不断收到一个错误。这是我在尝试git push origin master
时得到的错误:从github无法推送或拉Git回购
To https://github.com/[me]/[project].git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'https://github.com/[me]/[project].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的方式,你必须先'fetch' +'merge'的其他修改(又名'pull')和*然后*'推'。 – GolfWolf
尝试拉动新的更新,然后推。 – NendoTaka
你也可以尝试'git pull --rebase',取决于远程仓库发生的事情以及你的工作流程。 – choroba