Push to origin/master was rejected

初始化的git项目,在托管平台创建项目,并生成项目基本信息,如果 .gitignore 文件

此时本地项目代码也有此文件,在执行git push -u origin master的时候,报如下错误信息

Push to origin/master was rejected

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.

原因:本地项目代码和托管平台上有代码冲突,可以先用git pull拉取下来更新,如果不行,

把托管平台的冲突文件.gitignore文件暂时先删除,即可提交成功。然后把不需要添加到版本控制

的文件,再次加到.gitignore文件并提交推送。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值