解决git问题

Push rejected: Push to origin/master was rejected

意思是git拒绝合并两个不相干的东西 
此时你需要在打开Git Bash,然后进入相应的目录,然后敲git命令

$ git pull origin master --allow-unrelated-histories

出现类似于这种信息就说明pull成功了:

$ git pull origin master --allow-unrelated-histories
From https://github.com/yanghaopeng/python_utils
* branch master -> FETCH_HEAD
Merge made by the 'recursive' strategy.
utils/hello.py | ++++++++++++++++++++++++++++++++++++++++++++++++++++-----
file changed, insertions(+), deletions(-)

将本地仓库中的推送到github中,使用如下的git命令:

$ git push -u origin master

完了,去刷新github,就可以看到东西已经推送成功

git问题--Push rejected: Push to origin/master was rejected的更多相关文章

  1. Push to origin/master was rejected (Git提交错误)

    [问题描述] 在使用Git Push代码的时候,会出现 Push to origin/master was rejected 的错误提示. 在第一次提交到代码仓库的时候非常容易出现,因为初始化的仓库和 ...

  2. Push to origin/master was rejected (Git提交错误)(转)

    [问题描述] 在使用Git Push代码的时候,会出现 Push to origin/master was rejected 的错误提示. 在第一次提交到代码仓库的时候非常容易出现,因为初始化的仓库和 ...

  3. Push rejected: Push master to origin/master was rejected /failed to push some refs to /git did not exit cleanly

    用studio提交代码报 Push rejected: Push master to origin/master was rejected 用TortiuseGit提交代码报下面错,(我是用这种方法解 ...

  4. Git出现提交错误--Push to origin/master was rejected(转)

    Step1:出现的问题? 在使用Git Push代码的时候,会出现Push to origin/master was rejected 的错误提示.在第一次提交到代码仓库的时候非常容易出现,因为初始化 ...

  5. Git上传项目到码云提示Push rejected: Push to origin/master was rejected

    感谢大佬:https://blog.csdn.net/weixin_41499217/article/details/82985582 Push rejected: Push to origin/ma ...

  6. Push rejected: Push to origin/master was rejected

    1.错误日志 : Maven projects need to be imported: Import Changes Enable Auto-Import : files committed: 初始 ...

  7. push to origin/master was rejected错误解决方案

    idea中,发布项目到OSChina的Git中,当时按照这样的流程添加Git,然后push,提示:push to origin/master war rejected". 解决方案如下: 1 ...

  8. idea 提交 Push rejected: Push to origin/master was rejected

    idea中,发布项目到码云上,当时按照这样的流程添加Git,然后push,提示:push to origin/master war rejected". 解决方案如下: 1.切换到自己项目所 ...

  9. idea push reject:push mater to origin/master was rejected by remote

    用idea commit之后,执行push操作,总是提示push reject:push mater to origin/master was rejected by remote,如下图 上网说执行 ...

随机推荐

  1. 面向对象先修:Java入门

    学习总结 在C语言和数据结构的基础上,在上暑期的面向对象Java先修课程时,熟悉语言的速度明显加快了很多.Java和C在很多基础语法上非常相似,比如基本的数据类型,循环以及条件分支语句,数组的遍历等. ...

  2. 2018.08.29 hdu3507 Print Article(斜率优化dp)

    传送门 这应该算是斜率优化的模板题了. 就是要求打印n个数,每个数有一个参数a[i],每打印一段连续的数[l,r]需要的花费是(a[[l]+...+a[r])2+m" role=" ...

  3. Repository模式中,Update总是失败及其解析(转)

    出处:http://www.cnblogs.com/scy251147/p/3688844.html 关于Entity Framework中的Attached报错的完美解决方案终极版 前发表过一篇文章 ...

  4. 疯狂安装oracle 12c,此版本没有scott这个用户

    今天要学习oracle,然后寻思下个吧,结果出现了很多问题,在此分享一下,搞疯了,太痛苦了,学的教程是用的 Oracle 11g,我去官网下载的Oracle 12g,文件很大,好不容易装好了,寻思就这 ...

  5. linux将程序扔到后台并获取程序的进程号

    我们经常需要写一些执行时间较长的程序,但是如果在程序执行过程中超时了,有许多原因,可能是程序已经挂起了,这时就需要杀死这样的进程,则可以通过如下的命令执行: java -jar TestProcess ...

  6. java中的类、对象、方法

    类=一个种类(class)东西 对象=属于该种类的一个对象/物件(object,台湾翻译为‘物件’)方法=对这个种类的东西都可以进行的操作 比如我有一辆汽车-类 public class car {. ...

  7. 4) Maven 安装

    # ----------------------------------------------------------------------------# Maven2 Start Up Batc ...

  8. WPF MediaKit的一点问题

    原版WPF MediaKit在捕获摄像头视频时,如果不使用640*480分分辨率输出,会出现NewVideoSample事件不被触发的问题. 经数日摸索,终于明白SetVideoCapturePara ...

  9. python Cannot uninstall 'numpy'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.

    在Python中移除(升级)numpy的时候出现: Cannot uninstall 'numpy'. It is a distutils installed project and thus we ...

  10. jbpm(流程管理)

    1.jbpm是什么 JBPM,全称是Java Business Process Management(业务流程管理),它是覆盖了业务流程管理.工作流.服务协作等领域的一个开源的.灵活的.易扩展的可执行 ...