gitup上传的坑 ! [rejected] master -> dev-gaochao (fetch first)......

git init  #在当前目录创建一个新的代码库

git add README.md   #添加readme.md文件

git commit -m '此处添加上传内容书名'  #提交暂停区到仓库

##开始添加远程仓库地址
git remote add origin 远程仓库地址

##提交代码到远程仓库去
git push -u origin master

一搬情况下提交到这一步第一次提交都会出现报错 
! [rejected]        master -> dev-gaochao (fetch first)
error: failed to push some refs to '...........'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

一脸蒙蔽,本来开开心心以为终于提交成功,原来成功的大门口还有一个坑 不得不跳的坑!废话不多说,出现这个报错大概原因就是因为你在创建远程仓库的时候创建了README.md文件,然后你上传的本地文件夹没有这个文件,所以出现这个报错信息
这个报错信息我统计了一下一共有两种解决办法

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值