Git error- fatal- Needed a single revision
最近在开发中由于项目结构的重构,有一部分代码被抽出来作为了公共库(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的更多相关文章
- 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~ ...
- 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 : ...
- git pull fatal: refusing to merge unrelated histories
1.首先我github有个远程仓库,然后我本地有个仓库 本地仓库我新添加了一个文件,然后我去关联(git remote add origin git@github.com:qshilary/gitte ...
- 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 ...
- 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 ...
- 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 ...
- [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' ...
- 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. 原 ...
- 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 ...
随机推荐
- Python学习总结 06 paramiko 远程执行命令
有时会需要在远程的机器上执行一个命令,并获得其返回结果.对于这种情况,python 可以很容易的实现. 1 工具 Python paramiko 1) Paramiko模块安装 在Linux的Term ...
- UIView与CALayer的区别,很详细
研 究Core Animation已经有段时间了,关于Core Animation,网上没什么好的介绍.苹果网站上有篇专门的总结性介绍,但是似乎原理性的东西不多,看得人云山雾罩,感觉,写那篇东西的人, ...
- 翻译Android USB HOST API
翻译Android USB HOST API 源代码地址:http://developer.android.com/guide/topics/connectivity/usb/host.html 译者 ...
- 往另外1个ListView中添加当前选中的项目
//往另外1个ListView中添加当前选中的项目 function AddSelItems(listview1:TListView;ListView2:TListView):Boolean; ...
- [Node.js] Scraping Dynamic JavaScript Websites with Nightmare
Many websites have more than just simple static content. Dynamic content which is rendered by JavaSc ...
- gprof + kprof + gprof2dot (性能 与 函数调用图)-
http://www.cnblogs.com/rocketfan/archive/2009/11/15/1603465.html http://blog.csdn.net/stanjiang2010/ ...
- css培训(三)
优先级 z-index 不设置 或auto 非static z-index :0 : z-index:-1: opacity 与层叠上下 opacity:.9 对其影响 小于1值 不具备堆叠 ...
- 11.2 morning
noip模拟题day1——棋盘上的问题 day1模拟题 By FancyCoder总览(Overview)注意事项:共3道题目,时间2.5小时.Pascal选手允许使用math库和ansistring ...
- js分家效应
(原创文章,转载请注明出处) 有继承,那么就有分家.让我们看以下例子. var parents = function(){ } parents.prototype.money = 200; var c ...
- Shell - 文件运算符
文件运算符 文件运算符 描述 -b file 检测 file 是否为块设备文件 -c file 检测 file 是否为字符设备文件 -d file 检测 file 是否为目录 -e fil ...