Git提示rejected

To github.com:zhuxiaoxi/Web-Demo.git

! [rejected] master -> master (fetch first)

error: failed to push some refs to 'git@github.com:zhuxiaoxi/Web-Demo.git'

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.

原因

远程仓库有一部分代码已经被包含不允许直接推送到远程仓库

解决方法

  • 在推送时,使用-f选项,强制推送
git push origin master -f

Git提示remote origin already exists

fatal: remote origin already exists.

原因

已经设置了一个远程仓库,无法设置新的

解决方法

  • 执行git remote rm origin,再修改远程仓库git remote add origin git@github.com:zhuxiaoxi/dotfiles.git

Git提示fatal: refusing to merge unrelated histories

git pull origin master

From github.com:zhuxiaoxi/dotfiles

  • branch master -> FETCH_HEAD

    fatal: refusing to merge unrelated histories

解决方法

  • 在拉取时,使用--allow-unrelated-histories选项,忽略无关的历史
git pull origin master --allow-unrelated-histories

Git提示Please make sure you have the correct access rights

ssh: Could not resolve hostname origin: Name or service not known
fatal: Could not read from remote repository. Please make sure you have the correct access rights
and the repository exists.

解决方法

# git push origin:peppa 错误,修改为下面的
git push origin :peppa

Git错误汇总的更多相关文章

  1. git 错误汇总

    ★一.git提交时报错:Updates were rejected because the tip of your current branch is behind 出现这样的问题是由于:自己当前版本 ...

  2. 常用Git命令汇总

    常用Git命令汇总 跟着R哥来到了新公司(一个从硬件向互联网转型中的公司),新公司以前的代码基本是使用SVN做版本控制,甚至有些代码没有做版本控制,所以R哥叫HG做了一次Git分享,准备把公司所有的代 ...

  3. Entity Framework学习笔记——错误汇总

    之前的小项目做完了,到了总结经验和更新学习笔记的时间了.开始正题之前先啰嗦一下,对之前的学习目标进行一个调整:“根据代码生成表”与“生成数据库脚本和变更脚本”合并为“Code First模式日常使用篇 ...

  4. git 错误:

    git  错误: $ git commit -afatal: Unable to create 'e:/git/Android/XXXXXX/.git/index.lock': File exists ...

  5. Git错误non-fast-forward后的冲突解决

    Git错误non-fast-forward后的冲突解决当要push代码到git时,出现提示: error:failed to push some refs to ... Dealing with “n ...

  6. Git错误non-fast-forward

    Git错误non-fast-forward后的冲突解决 [日期:2012-04-21] 来源:Linux社区  作者:chain2012 [字体:大 中 小]   当要push代码到git时,出现提示 ...

  7. 李洪强iOS开发之OC常见错误汇总

    // //  main.m //  16 - 常见错误汇总 // //  Created by vic fan on 16/7/13. //  Copyright © 2016年 李洪强. All r ...

  8. git错误:fatal: Not a git repository (or any of the parent directories): .git

    git错误:fatal: Not a git repository (or any of the parent directories): .git 我用git add file添加文件时出现这样错误 ...

  9. Python常见的错误汇总

    +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 错误: [错误分析]第二个参数必须为类,否则会报TypeError,所以正确的应 ...

随机推荐

  1. mybatis一级缓存详解

    mybatis缓存分为一级缓存,二级缓存和自定义缓存.本文重点讲解一级缓存 一:前言 在介绍缓存之前,先了解下mybatis的几个核心概念: * SqlSession:代表和数据库的一次会话,向用户提 ...

  2. object-fit 属性的用法介绍

    这个要在宽,高都是100%的情况下才能提现 object-fit 属性的用法介绍 fill(不保持纵横比缩放图片,使图片完全适应) contain(保持纵横比缩放图片,使图片的长边能完全显示出来) c ...

  3. 【apache2】AH00543: httpd: bad user name apache

    当启动 apache 时,出现一下异常:AH00543: httpd: bad user name daemon 解决方法:            #groupadd daemon          ...

  4. 如何使用apache自带的ab压力测试工具

    ab是apache自带的一个很好用的压力测试工具,当安装完apache的时候,就可以在bin下面找到ab 1 我们可以模拟100个并发用户,对一个页面发送1000个请求 ./ab -n1000 -c1 ...

  5. kubernetes资源类别介绍

    类别 名称 资源对象 Pod.ReplicaSet.ReplicationController.Deployment.StatefulSet.DaemonSet.Job.CronJob.Horizon ...

  6. query中对应的OnSetText和onGetText事件

    今天在看代码的时候遇到一个问题,query中的某个字段和在表中显示的不是一个值,我觉得很奇怪,于是找了很久,才知道为什么,原来是query中的OnSetText和onGetText事件在作怪,经过一番 ...

  7. 扩展运算符(spread)是三个点(…)

    扩展运算符(spread)是三个点(…),将一个数组||类数组||字符串转为用逗号分隔的序列. js中用来对数组进行操作,把数组里面的东西统统拿出来 一.展开数组 //展开数组 let a = [1, ...

  8. Wpf ViewModel中 ObservableCollection不支持从调度程序线程以外的线程对其 SourceCollection 进行的更改

    Wpf中ViewModel类里面经常会需要用到ObservableCollection来管理列表数据,在做异步通信的时候也会碰到“不支持从调度程序线程以外的线程对其 SourceCollection ...

  9. 学习 Spring (五) Aware 接口

    Spring入门篇 学习笔记 Spring 中提供了一些以 Aware 结尾的接口,实现了 Aware 接口的 bean 在被初始化之后可以获取相应资源 通过 Aware 接口,可以对 Spring ...

  10. 洛谷 P3951 小凯的疑惑

    题目链接 一开始看到这题,我的内心是拒绝的. 以为是同余类bfs,一看数据1e9,发现只能允许O(1)的算法,数学还不太好,做不出来,其实应该打表找规律. 看到网上的题解,如果两个都必须拿,结果一定是 ...