最近在开发中由于项目结构的重构,有一部分代码被抽出来作为了公共库(git submodule),这样公共库可以独立维护,同时其他库调用它也是非常方便的,避免了到处复制代码的痛苦。

但我在项目重构后第一次pull更新时发现,更新十分的缓慢,好像是submodule 项目pull不下来,然后失去耐心后取消操作并重新下拉,git就会一直在报 fatal: Needed a single revision错误,十分无奈。进入项目文件目录后会发现,submodule的项目文件夹已存在,但是里面是空的,貌似就是这个原因导致了上述错误。

后来经过网上查阅资料后,找到了一个较好的解决方案。

1.  git rm -rf DFM/DanmakuFlameMaster(submodule下的工程路径名)
当然你也可以直接在文件夹目录中把submodule path下文件夹直接删除,哈哈。
2. git submodule update --init

只需轻松两步就可以轻松的解决fatal: Needed a single revision的错误啦,哈哈,是不是很简单。

参考资料

作者:XycZero

查看原文:http://www.xyczero.com/blog/article/24/.

Git error- fatal- Needed a single revision的更多相关文章

  1. Git执行"git rebase -i HEAD~xxx"报错:git rebase fatal: Needed a single revision invalid upstream –i

    一.问题"git rebase -i HEAD~xxx"是修改git 历史记录的一个很有用的命令. 但是有时在执行该命令时会出现以下错误:$ git rebase –i HEAD~ ...

  2. Git error on commit after merge - fatal: cannot do a partial commit during a merge

    Git error on commit after merge - fatal: cannot do a partial commit during a merge this answer is : ...

  3. git pull fatal: refusing to merge unrelated histories

    1.首先我github有个远程仓库,然后我本地有个仓库 本地仓库我新添加了一个文件,然后我去关联(git remote add origin git@github.com:qshilary/gitte ...

  4. git error Another git process seems to be running in this repository

    How to fix error Another git process seems to be running in this repository When you use Git, you se ...

  5. Waring:not all local change may be shown due to an error:fatal

    idea往Git上提交文件时提示 Waring:not all local change may be shown due to an error:fatal 解决方案:选择File --> s ...

  6. mysql [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist (转载)

    mysql报错Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist 2013-11-2 ...

  7. [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist

    mysql 启动总是报错: 错误日志中显示: [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' ...

  8. Push failed: Failed with error: fatal: Could not read from remote repository.

    GitLab push远端,出现错误提示:Push failed: Failed with error: fatal: Could not read from remote repository. 原 ...

  9. Error:The SDK Build Tools revision (19.0.3) is too low for project ':app'. Minimum required is 19.1.

    今天更新了一下AndroidStudio, 结果编译程序时报错, 错误如下: Error:The SDK Build Tools revision (19.0.3) is too low for pr ...

随机推荐

  1. HTML5笔记(一)

    1.HTML5提供了一些新的元素和属性,例如<nav>(网站导航块)和<footer>.这些标签较有利于搜索引擎的索引整理,同时更好的帮助小屏幕装置和视频人士使用,除此之外,还 ...

  2. rails tutorial sample app

    阅读第3章时,按照教程第一次运行rspec失败了: E:\05 Create\Code\temp\railstutorial\sample_app>rspec spec/requests/sta ...

  3. String的成员方法的使用

    <%@ page language="java" contentType="text/html; charset=gbk"%> <html&g ...

  4. 【转】jQuery列表拖动排列-jquery list dragsort插件参数和使用方法

    转自:http://www.itokit.com/2014/0820/75058.html 我们在编辑页面元素排序的时候,我推荐使用jquery插件:dragsort. dragsort官网地址:ht ...

  5. iOS开发总结-UIWebView 集成 浏览器

    // // detailWebViewController.m // BJ // // Created by shirenfeng on 16/11/6. // Copyright © 2016年 c ...

  6. [Oracle] Data Pump 详细使用教程(4)- network_link

    [Oracle] Data Pump 详细使用教程(1)- 总览 [Oracle] Data Pump 详细使用教程(2)- 总览 [Oracle] Data Pump 详细使用教程(3)- 总览 [ ...

  7. HDU5047Sawtooth(java大数)

    HDU5047Sawtooth(java大数) 题目链接 题目大意:在一个矩形内画n个"M".问如何画可以把这个矩形分成最多的区域. 给出这个区域的数目. 解题思路:最好的方式就是 ...

  8. Swing的设计是MVC的典范

    无论你的项目是否用到了Swing技术,我都要说,Swing是一个设计优秀的Java包,它充满了大师的智慧.假设你学了Java却连一个Button还不会写,就象你学习Visual Basic却不会用Bu ...

  9. cocos2d-x3.0 ListView

    .h #include "cocos2d.h" #include "cocos-ext.h" #include "ui/CocosGUI.h" ...

  10. 谈一下怎样设计Oracle 分区表

    在谈设计Oracle分区表之间先区分一下分区表和表空间的个概念: 表空间:表空间是一个或多个数据文件的集合,全部数据对象都存放在指定的表空间中,但主要存放表,故称表空间. 分区表:分区致力于解决支持极 ...