! [remote rejected] master -> master (shallow update not allowed)

https://stackoverflow.com/questions/28983842/remote-rejected-shallow-update-not-allowed-after-changing-git-remote-url

As it seems you have used git clone --depth <number> to clone your local version. This results in a shallow clone. One limitation of such a clone is that you can't push from it into a new repository.

You now have two options:

  1. if you don't care about you're current or missing history, take a look at this question
  2. if you want to keep your full history, then continue reading:

So, you want to keep your history, eh? This means that you have to unshallow your repository. To do so you will need to add your old remote again.

git remote add old <path-to-old-remote>

After that we use git fetch to fetch the remaining history from the old remote (as suggested in this answer).

git fetch --unshallow old

And now you should be able to push into your new remote repository.


Note: After unshallowing your clone you can obviously remove the old remote again.

个人分析:

比如从网址1(github) clone一个repository,但是repository很大。过了一段时间,可能git后台回收了一部分objects,太久不用的。

那么等你想要更换网址2(osc)的时候,比如push到osc的时候。

这个时候push,可能就会少一些文件。

那么需要git fetch --unshallow github

然后再git push osc

shallow update not allowed的更多相关文章

  1. Git - grafted 和 shallow update not allowed

    一般人对开源的模板进行修改是总会进行这样的一条龙操作 # 克隆最近一次提交 git clone xxx --depth 1 # 修改修改修改 提交提交提交 vim xxx git commit -am ...

  2. 运行 composer update,提示 Allowed memory size of bytes exhausted

    composer update运行之后,提示 PHP Fatal error: Allowed memory size of 1610612736 bytes exhausted (tried to ...

  3. Vue-数据绑定原理

    VueJS 使用 ES5 提供的 Object.defineProperty() 方法实现数据绑定. 感觉实现时主要是在 defineProperty 的 set 和 get 上做了很多文章,在 ge ...

  4. Nutch源码阅读进程3---fetch

    走了一遍Inject和Generate,基本了解了nutch在执行爬取前的一些前期预热工作,包括url的过滤.规则化.分值计算以及其与mapreduce的联系紧密性等,自我感觉nutch的整个流程是很 ...

  5. nutch-default.xml文件

    Nutch中的所有配置文件都放置在总目录下的conf子文件夹中,最基本的配置文件是conf/nutch-default.xml.这个文件中定义了 Nutch的所有必要设置以及一些默认值,它是不可以被修 ...

  6. Nutch源码阅读进程3

    走了一遍Inject和Generate,基本了解了nutch在执行爬取前的一些前期预热工作,包括url的过滤.规则化.分值计算以及其与mapreduce的联系紧密性等,自我感觉nutch的整个流程是很 ...

  7. Nutch的nutch-default.xml和regex-urlfilter.txt的中文解释

    nutch-default解释.xml <?xml version="1.0"?> <?xml-stylesheet type="text/xsl&qu ...

  8. Oracle Form's Trigger Tutorial With Sample FMB

    Created an Oracle Form to handle specific events / triggers like When-New-Form-Instance, Pre-Insert, ...

  9. Nutch学习笔记二——抓取过程简析

    在上篇学习笔记中http://www.cnblogs.com/huligong1234/p/3464371.html 主要记录Nutch安装及简单运行的过程. 笔记中 通过配置抓取地址http://b ...

随机推荐

  1. 001---mysql分库分表

    mysql分库分表 一.整体的切分方式 1.分库分表:即数据的切分就是通过某种特定的条件,将我们存放在同一个数据库中的数据分散存放到多个数据库(主机)中,以达到分散单台设备负载的效果 2.数据的切分根 ...

  2. 爬虫之requests 高级用法

    1. 文件上传 import requests files = {'file': open('favicon.ico', 'rb')} r = requests.post("http://h ...

  3. 一波骚操作,我把 SQL 执行效率提高了 10,000,000 倍!

    作者:风过无痕-唐 http://www.cnblogs.com/tangyanbo/p/4462734.html 场景 我用的数据库是mysql5.6,下面简单的介绍下场景 课程表: create  ...

  4. mybatis问题整理

    // List<String> findBuildByProject(String prjName); //单参数时使用<if></if>标签判断采用"_ ...

  5. [Codeforces 639F] Bear and Chemistry (Tarjan+虚树)(有详细注释)

    [Codeforces 639F] Bear and Chemistry(Tarjan+虚树) 题面 给出一个n个点,m条边的无向图(不保证连通,可能有自环和重边),有q次询问,每次询问给出p个点和q ...

  6. 【题解】Hankson 的趣味题

    题目大意 已知正整数$a_{0}$.$a_{1}$.$b_{0}$.$b_{1}$($1 \leq a_{0}, a_{1}, b_{0}, b_{1} \leq 2 \times 10^{9}$), ...

  7. 基于Zookeeper实现客户端动态监听服务器上下线

    一.在具体实现之前,先来了解一下Zookeeper的监听器的原理: 图中Main()线程作为客户端,当在主线程中创建Zookeeper客户端时,会默认创建两个子线程:Listener和connect, ...

  8. redhat6.5单用户重置root密码

    (1),按 “e” 键进入该界面,继续按 “e” 键进入下一个界面. (2).上下键选中第二个kernel选项,继续按 “e” 键进行编辑. (3).在新的界面里面加一个空格,再输入“1”:或者输入“ ...

  9. Java 8实战之读书笔记五:超越Java 8

    四.超越Java 8 第13章 函数式的思考 下面是这一章中你应该掌握的关键概念.      从长远看,减少共享的可变数据结构能帮助你降低维护和调试程序的代价.      函数式编程支持无副作用的 ...

  10. Linux学习笔记之目录配置

    一.目录配置 相关目录说明 /bin              二进制文件 /boot           系统启动文件(内核的初始化文件等) /dev            设备文件(硬盘等) /e ...