赞
踩
在git push时无法推送到远端仓库,出现下面的信息
$ git push origin master
To https://github.com/USERNAME/REPOSITORY.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to ‘https://github.com/USERNAME/REPOSITORY.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官网上基于此提出的问题背景是
Sometimes, Git can’t make your change to a remote repository without losing commits. When this happens, your push is refused.If another person has pushed to the same branch as you, Git won’t be able to push your changes.
即远端仓库有了比你本地分支更新的commit,不允许你的此次修改直接推送到远端分支。
方案一:官网上给出的方法是
fix this by fetching an
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。