简体   繁体   中英

How can I disable submodules in git?

I'm trying to make a private mono-repo, with sub packages that have public gits. At no point do I have any intent of modifying the code outside of my mono-repo, so I have no need for submodules. In fact, they're the very thing I'm trying to avoid at all costs.

I don't want to delete the .gits for any of the packages in my mono-repo, and I don't want to do anything fancy.

How can I simply disable submodule functionality in git?

I don't ever want anything to be considered a submodule. Never have, and probably never will.

I've tried searching for some .submodule folder or something in the git. I found none. There appears to be no settings to get rid of these things.

I've found this link: un-submodule a git submodule

Unfortunately, these solutions all have to do with flattening submodules, and none of them cover a way to just disable the feature entirely.

Git doesn't have a feature to disable submodules. They're considered part of the core functionality and Git doesn't have options to disable core functionality like that. It's extremely unlikely that such a feature would be added.

If you don't want your subrepos to be accidentally be checked in as submodules, you can ignore them, in which case Git won't check them in. If they're already checked in, you can just run git rm --cached DIRECTORY for each submodule and then remove the .gitmodules file, then add them to .gitignore .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM