每次建立新的仓库,提交的时总会出现这样的错误,真是头疼,......

直接开始正题,git 提交的步骤:

1. git init //初始化仓库
2. git add .(文件name) //添加文件到本地仓库
3. git commit -m "first commit" //添加文件描述信息
4. git remote add origin + 远程仓库地址 //链接远程仓库,创建主分支
 
5. git push -u origin master //把本地仓库的文件推送到远程仓库
 
提交之后就会出现以下错误
要想解决以上错误,只需要在4,5之间使用git pull origin master即可
 
 
正确步骤:
1. git init //初始化仓库
2. git add .(文件name) //添加文件到本地仓库
3. git commit -m "first commit" //添加文件描述信息
4. git remote add origin + 远程仓库地址 //链接远程仓库,创建主分支
5. git pull origin master // 把本地仓库的变化连接到远程仓库主分支
6. git push -u origin master //把本地仓库的文件推送到远程仓库
 
OK
搞定,回家吃饭!!

Updates were rejected because the remote contains work that you do的更多相关文章

  1. Git error: hint: Updates were rejected because the remote contains work that you do hint: not have locally. This is usually caused b

    hint: Updates were rejected because the remote contains work that you dohint: not have locally. This ...

  2. Updates were rejected because the remote contains work that you do(git报错解决方案)

    Updates were rejected because the remote contains work that you do(git报错解决方案) 今天向GitHub远程仓库提交本地项目文件时 ...

  3. Git error: hint: Updates were rejected because the remote contains work that you do hint: not have locally

    hint: Updates were rejected because the remote contains work that you dohint: not have locally. This ...

  4. 【gitlab】首次提交本次代码到gitlab上,报错:Updates were rejected because the remote contains work that you do

    首次提交本次代码到gitlab上,报错:Updates were rejected because the remote contains work that you do 报错情况如下: 错误原因: ...

  5. Updates were rejected because the remote contains work that you do(gitee报错解决方案)

    今天向Gitee远程仓库提交本地项目文件时,遇到了下列错误,很是郁闷 正在推送 1203笔记本Error: failed to push some refs to 'https://gitee.com ...

  6. 报错 hint: Updates were rejected because the remote contains work that you do 解决方法

    1. git pull origin master --allow-unrelated-histories 2.git pull origin master 3.git init 4.git remo ...

  7. error: failed to push some refs to 'https://github.com/github账号/learn_git.git' hint: Updates were rejected because the remote contains work that you do hint: not have locally. This is usually caus

    在使用git 对源代码进行push到gitHub时可能会出错,信息如下   此时很多人会尝试下面的命令把当前分支代码上传到master分支上. $ git push -u origin master ...

  8. 将分支推送到远程存储库时遇到错误: rejected Updates were rejected because the remote contains work that you do not have locally

    在仓库目录下执行 git pull origin master --allow-unrelated-histories 之后就可以成功的pull,push了

  9. git上传文件夹报错: ! [rejected] master -> master (fetch first) error: failed to push some refs to 'https://github.com/taminachen/rjxm.git' hint: Updates were rejected because the remote contains work

    使用git上传本地文件夹到远程仓库,使用如下命令:git push -u origin master时报错 原因是在GitHub创建仓库时创建了readme文件,但是本地没有这个文件,造成本地目录与远 ...

随机推荐

  1. Kubernetes环境下的各种调试方法

    作者:Jack47 转载请保留作者和原文出处 欢迎关注我的微信公众账号程序员杰克,两边的文章会同步,也可以添加我的RSS订阅源. 本文介绍在Kubernetes环境下的调试方法,希望对读者有用.如果关 ...

  2. idea bug集合

    问题1:点击debug调试时会报下面这种错误 Error running tomcat: Unable to open debugger port (127.0.0.1:64582): java.ne ...

  3. NestedScrollView嵌套RecycleView 滑动 实现上滑隐藏 下滑显示头部效果

    废了好大的劲才弄好的,记下来 方便以后查看 public class MainActivity extends AppCompatActivity { private RecyclerView mRe ...

  4. setTimeout 和 setInteval 的区别。

    学习前端的可能都知道js有2个定时器setTimeOut和setinteval.用的时候可能不是很在意,但是2者还是有区别的 setTimeout方法是定时程序,也就是在什么时间以后干什么.干完就完了 ...

  5. yii2.0套用模板问题

    载入视图 在控制器中: $this->render(); 会加载布局 $this->renderPartial(); 不会加载布局(也不能载入框架自带的jquery等) Yii2 选择布局 ...

  6. KVO 模式详解

    KVO:观察者模式.当指定的被观察对象属性被修改时,允许对象接收到通知的机制. p.p1 { margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo; ...

  7. User Browsing Model简介

    搜索引擎的点击日志提供了很多有价值的query-doc相关性信息,但是这些信息是有偏的,因为对于用户没有点击过的doc,我们无法确定其是否真实地被用户浏览过.即日志中记录的展现信息与实际的展现信息之间 ...

  8. framework7+node+mongo项目

    Famework7还是一个不错的前端框架 不过这个小项目做下来确实踩了不少的坑 废话不多说上干货 项目代码:https://github.com/tsxylhs/framework7

  9. linux性能分析及调优

    第一节:cpu 性能瓶颈 计算机中,cpu是最重要的一个子系统,负责所有计算任务: 基于摩尔定律的发展,cpu是发展最快的一个硬件,所以瓶颈很少出现在cpu上: 我们线上环境的cpu都是多核的,并且基 ...

  10. 【算法系列学习】[kuangbin带你飞]专题十二 基础DP1 E - Super Jumping! Jumping! Jumping!

    https://vjudge.net/contest/68966#problem/E http://blog.csdn.net/to_be_better/article/details/5056334 ...