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

直接开始正题,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. [原]使用MessageAnalyzer实时查看远端日志

    1. 下载安装Message Analyzer 从Message Analyzer下载链接下载,安装过程从略. 说明:关于Message Analyzer的视频教程,可以在打开后的主界面上看到. 2. ...

  2. php基础知识--2017-04-14

    1.Php的两种打开方式: 第一种方式:http://localhost/0414/qq.php 第二种:新建站点,选到www目录.点击服务器----+添加-------选择本地网络   ------ ...

  3. 关闭discuzX3.2注册页面的注册邮箱验证

    论坛升级后发现注册用户在输入任何邮箱email时,一直提示email 地址无效.用firephp跟踪发现:随机生成的email的后缀是@localhost! 找到原因,修改如下: //原来代码 if( ...

  4. kNN算法个人理解

    新手,有问题的地方请大家指教 训练集的数据有属性和标签 同类即同标签的数据在属性值方面一定具有某种相似的地方,用距离来描述这种相似的程度 k=1或则较小值的话,分类对于特殊数据或者是噪点就会异常敏感, ...

  5. java 解析xml文档---通过XmlPullParser解析方式

    package com.zx; import java.io.FileInputStream; import java.io.IOException; import java.util.ArrayLi ...

  6. Python之路- 反射&定制自己的数据类型

    一.isinstance和issubclass isinstance(obj,cls)检查是否obj是否是类 cls 的对象 issubclass(sub, super)检查sub类是否是 super ...

  7. 基于R树索引的点面关系判断以及效率优化统计

    文章版权由作者李晓晖和博客园共有,若转载请于明显处标明出处:http://www.cnblogs.com/naaoveGIS/ 1.背景 在之前的博客中,我分别介绍了基于网格的空间索引(http:// ...

  8. Mongo汇总问题

    1. 数据 /* 5 */ { "_id" : ObjectId("5902f7ca2b3fe442d60a0946"), "code" : ...

  9. 大数据及hadoop相关知识介绍

    一.大数据的基本概念 1.1什么是大数据 互联网企业是最早收集大数据的行业,最典型的代表就是Google和百度,这两个公司是做搜索引擎的,数量都非常庞大,每天都要去把互联网上的各种各样的网页信息抓取下 ...

  10. Java基础语法(一)<注释,关键字,常量,变量,数据类型,标识符,数据类型转换>

    从今天开始,记录学习Java的过程.要学习Java首先得有环境,至于环境的安装我就不说了,百度有很多教程,比如:http://jingyan.baidu.com/article/20095761904 ...