Date
Sep. 8th, 2024
 
2024年 8月 6日

Post: How to effectively delete a git submodule

How to effectively delete a git submodule

Published 02:05 May 17, 2024.

Created by @ezra. Categorized in #Version Control, and tagged as #Git.

Source format: Markdown

Table of Content

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes: git add .gitmodules.
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule <name>".
  • Delete the now untracked submodule files: rm -rf path_to_submodule.
Pinned Message
HOTODOGO
The Founder and CEO of Infeca Technology.
Developer, Designer, Blogger.
Big fan of Apple, Love of colour.
Feel free to contact me.
反曲点科技创始人和首席执行官。
程序猿、设计师、奇怪的博主。
苹果死忠、热爱色彩斑斓的世界。
如有意向请随时 与我联系