您当前的位置: 首页 >  git

王佳斌

暂无认证

  • 4浏览

    0关注

    821博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

Git 远程推送报错:[rejected] master -」 master (fetch first) error: failed to push some refs to ‘

王佳斌 发布时间:2020-07-11 21:13:14 ,浏览量:4

完整报错信息

背景:这个项目以前在 Github 上推送过一次,现在想推送到 Gitee 。

Git 推送远程仓库时,出现如下报错:

To gitee.com:wangjiabin-x/light-mvvm.git
 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'git@gitee.com:wangjiabin-x/light-mvvm.git'
hint: Updates were rejected because the tip of your current branch is behind
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.
解决

因为 README.md 文件不在本地代码目录中,可以通过如下命令进行代码合并,得以解决:

git pull --rebase origin master

然后再执行推送命令:

git push origin master

成功。

关注
打赏
1665568777
查看更多评论
立即登录/注册

微信扫码登录

0.0445s