使用git命令行提交代码到github上报错(一)

来源:互联网 发布:苏联巅峰 知乎 编辑:程序博客网 时间:2024/05/22 16:47

报错提示如下:
Administrator@PC-20150110FGWU /K/cocos2d/yc (master)
$ git push -u origin master
To git@github.com:yangchao0718/cocos2d.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to ‘git@github.com:yangchao0718/cocos2d.git
hint: Updates were rejected because the tip of your current branch is behin
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.

原因是,在你的远程仓库中有文件并没有同步到你的本地仓库,导致提交失败,所以在每次提交代码到远程仓库前先同步一下远程仓库的代码!

0 0