Remove a Submodule within git
For many git-based projects, submodules are useful in avoiding duplicate work and easing utility library updates. There are times, however, when a submodule needs to be removed from a project. Submodules aren't removed with git rm submoduledir, they must be removed in a more tedious, manual fashion. There are many unclear explanations of how to remove a submodule but I found one on Stack Overflow that's concise, so I thought I'd share it. The steps are as follows:
- Delete the relevant section from the
.gitmodulesfile. The section would look similar to:[submodule "vendor"]
path = vendor
url = git://github.com/some-user/some-repo.git - Stage the
.gitmoduleschanges via command line using:git add .gitmodules - Delete the relevant section from
.git/config, which will look like:[submodule "vendor"]
url = git://github.com/some-user/some-repo.git - Run
git rm --cached path/to/submodule. Don't include a trailing slash -- that will lead to an error. - Run
rm -rf .git/modules/submodule_name - Commit the change:
- Delete the now untracked submodule files
rm -rf path/to/submodule
Those steps will get you rid of that unwanted submodule. A lot harder than adding one, eh?
from: http://davidwalsh.name/git-remove-submodule
Remove a Submodule within git的更多相关文章
- Remove all your local git branches but keep master
Sometimes after a sprint, all the remaining branches are just taking up space. Here's a small snippe ...
- git submodule 使用
这个是备忘录,原网页: https://medium.com/@porteneuve/mastering-git-submodules-34c65e940407 http://cncc.bingj.c ...
- 转:Git Submodule管理项目子模块
使用场景 当项目越来越庞大之后,不可避免的要拆分成多个子模块,我们希望各个子模块有独立的版本管理,并且由专门的人去维护,这时候我们就要用到git的submodule功能. 常用命令 git clone ...
- Git submodule - 子模块【转】
子模块 有种情况我们经常会遇到:某个工作中的项目需要包含并使用另一个项目. 也许是第三方库,或者你独立开发的,用于多个父项目的库. 现在问题来了:你想要把它们当做两个独立的项目,同时又想在一个项目中使 ...
- [转]使用Git Submodule管理子模块
本文转自:https://blog.csdn.net/qq_37788558/article/details/78668345 实例代码: 父项目:https://github.com/jjz/pod ...
- Git Submodule管理项目子模块
使用场景 当项目越来越庞大之后,不可避免的要拆分成多个子模块,我们希望各个子模块有独立的版本管理,并且由专门的人去维护,这时候我们就要用到git的submodule功能. 常用命令 git clone ...
- 使用Git Submodule管理子模块
转自:https://segmentfault.com/a/1190000003076028 使用场景 基于公司的项目会越来越多,常常需要提取一个公共的类库提供给多个项目使用,但是这个library怎 ...
- Git: fatal: Pathspec is in submodule
出现是问题: git提交代码是出现fatal: Path 'directory/file' is in submodule 'directory''错误 Removing the directory ...
- Git Submodule使用完整教程
Git Submodule功能刚刚开始学习可能觉得有点怪异,所以本教程把每一步的操作的命令和结果都用代码的形式展现给大家,以便更好的理解. 1.对于公共资源各种程序员的处理方式 每个公司的系统都会有一 ...
随机推荐
- could not read data from '/Users/lelight/Desktop/ViewControllerLife/ViewControllerLife/Info.plist': The file “Info.plist” couldn’t be opened because there is no such file.
1.Info.plist放置至新文件夹下,路径被修改了,报错. could not read data from '/Users/lelight/Desktop/ViewControllerLife/ ...
- RESTful API概念解析
什么是restful? REST与技术无关,代表的是一种软件架构风格,REST是Representational State Transfer的简称,中文翻译为“表征状态转移”或“表现层状态转化”. ...
- 如何离线Windows server 2008R2 激活教程?
服务器离线激活,可是费了老大劲了,不过最后还不是离线激活,还必须联网,也或许你运气好,不联网也能激活. 如果由于种种原因不能有线的话,那就可以试试这种方法了. 1.首先,开启无线LAN服务.(不会开启 ...
- JavaWeb学习笔记(十四)—— 使用JDBC处理MySQL大数据
一.什么是大数据 所谓大数据,就是大的字节数据,或大的字符数据.大数据也称之为LOB(Large Objects),LOB又分为:clob和blob,clob用于存储大文本,blob用于存储二进制数据 ...
- Android IntentService 的使用
1.service 执行耗时任务的步骤 2.IntentService (1)介绍 (2)使用方法 (3)优点 (4)在AndroidManifest.xml文件中添加service设置 <se ...
- HLS-搭建Nginx流媒体服务器
Nginx本身是一个非常出色的HTTP服务器,FFMPEG是非常好的音视频解决方案.这两个东西通过一个nginx的模块nginx-rtmp-module,组合在一起即可以搭建一个功能相对比较完善的流媒 ...
- Luogu P1108 低价购买 DP
第一问求最长下降子序列,不提: 第二问:借鉴了最短路的方法??? 我们求出来了每个位置的最长下降子序列的长度,那么刻意这样这样转移 if f[i]==f[j]+1&&a[i]<a ...
- HDU 6321 (状压dp)
题目大意:: 为给你n个点(n<=10,nn<=10,n) 初始时没有边相连 然后有m个操作(m<=30000m<=30000) 每次可以添加一条边或删除一条边 允许有重边 要 ...
- 编辑距离及编辑距离算法(求字符的相似度) js版
编辑距离概念描述: 编辑距离,又称Levenshtein距离,是指两个字串之间,由一个转成另一个所需的最少编辑操作次数.许可的编辑操作包括将一个字符替换成另一个字符,插入一个字符,删除一个字符. 例如 ...
- python (1) 还不是大全的小问题
1.pythone 获取系统时间 import datetime nowTime=datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')#现在 pa ...