删除隐性的git submodule

栏目: 编程工具 · 发布时间: 7年前

内容简介:删除隐性的git submodule(金庆的专栏 2018.8)正常的submodule会在 .gitmodule 文件中,TortoiseGit 会有 Submodule Update 菜单。

删除隐性的git submodule

(金庆的专栏 2018.8)

正常的submodule会在 .gitmodule 文件中,TortoiseGit 会有 Submodule Update 菜单。

还有一种隐性的 submodule, .gitmodule 文件中看不到它,无法 update.

golang开发中的vendor目录下经常会不小心添加一个带 .git 的目录,就变成了一个假的submodule.

用 Repo-browser 看这个目录是个submodule链接, clone 出来就只有一个空目录。

删除这个submodule不能用 git delete, 提交时会报错:

git.exe add -f [...]

fatal: pathspec 'src/vendor/github.com/grpc-ecosystem/grpc-opentracing' did not match any files

git did not exit cleanly (exit code 128)

git delete 父目录也无法提交。

但是可以直接删除(不用git delete), 然后提交并Push. 好像只有这个办法。


以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

API Design for C++

API Design for C++

Martin Reddy / Morgan Kaufmann / 2011-2-18 / USD 59.95

The design of application programming interfaces can affect the behavior, capabilities, stability, and ease of use of end-user applications. With this book, you will learn how to design a good API for......一起来看看 《API Design for C++》 这本书的介绍吧!

HTML 编码/解码
HTML 编码/解码

HTML 编码/解码

HEX CMYK 转换工具
HEX CMYK 转换工具

HEX CMYK 互转工具