当前位置: 代码迷 >> 综合 >> git --- ! [rejected] master - master (non-fast-forward)
  详细解决方案

git --- ! [rejected] master - master (non-fast-forward)

热度:96   发布时间:2023-11-25 10:50:26.0

如何解决failed to push some refs to git

Administrator@PC-20150110FGWU /K/cocos2d/yc (master)$ git push -u origin masterTo git@github.com:yangchao0718/cocos2d.git! [rejected]        master -> master (non-fast-forward)error: failed to push some refs to 'git@github.com:yangchao0718/cocos2d.githint: Updates were rejected because the tip of your current branch is behinhint: 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.

1、出现错误的主要原因是github中的README.md文件不在本地代码目录中

2、可以通过如下命令进行代码合并   git pull --rebase origin master

  相关解决方案