您的位置:首页 > 编程语言

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

2017-02-15 20:23 232 查看
报错提示如下:

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.

原因是,在你的远程仓库中有文件并没有同步到你的本地仓库,导致提交失败,所以在每次提交代码到远程仓库前先同步一下远程仓库的代码!
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  git