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. [转帖]Linux 下如何知道是否有人在使坏?

    Linux 下如何知道是否有人在使坏? 学到了两个最简单的命令 usermod -L username 锁定账户 passwd -s username 查看用户状态. 自己linux 知道的还是少 需 ...

  2. 查看端口占用cmd命令

    查看端口被占用的进程: 在任务管理器中结束进程:

  3. python之路--while, 格式化输出, 编码

    一 . while循环 while 条件: 循环体(break, continue) while True: content = input('你想对我说什么:,输入你最帅退出') if conten ...

  4. 《笔记》Apache2 mod_wsgi的配置

    接手了一台古老的服务器的还使用的是mod_wsgi,所以需要配置一下.其实这里有点怀念,记得当年自己折腾第一个app的时候,还是个什么都不懂的菜鸡.当时用django搜方案的时候,还不知道有uwsgi ...

  5. python3文字转语音

    #安装库(必须先安装pywin32) pip3 install pyttsx3 简单测试 import pyttsx3 engine = pyttsx3.init() text='name' engi ...

  6. 5款Python程序员高频使用开发工具推荐

    很多Python学习者想必都会有如下感悟:最开始学习Python的时候,因为没有去探索好用的工具,吃了很多苦头.后来工作中深刻体会到,合理使用开发的工具的便利和高效.今天,我就把Python程序员使用 ...

  7. 老男孩python学习自修【第一天】文件IO用法

    第一天   文件IO处理 1.读文件实例 file_split.python f = file('myFile.txt', 'r') for line in f.readlines(): line = ...

  8. PHP超级全局变量、魔术变量和魔术函数

    PHP超级全局变量(9个) $GLOBALS 储存全局作用域中的变量 $_SERVER 获取服务器相关信息 $_REQUEST 获取POST和GET请求的参数 $_POST 获取表单的POST请求参数 ...

  9. excel 公式 insert 语句

    ="insert into tb_fdn_deviceaccount (zdmc,czmc,sbbh,sbmc,SZCS,SBFLMC,SBLXMC,SBGG,SBYZ,SBJZ,SBXH, ...

  10. 使用电脑adb给Essential Phone刷机 —(官方篇)

    用ADB给Essential Phone线刷升级 重要:请确保在刷机前已经解锁,关于解锁教程群里有! 准备 原版boot Twrp boot Magisk卡刷包 到官网下载OTA包 准备好Essent ...