Quick Tip: How to remove a Git Submodule

I love working with git, since I started toying around with it a few months back, and find it to be a far superior version control system to subversion

Anyhow, working with submodules, it’s quite easy to add, init and sync, so you keep your sub-projects in-tact and up-to-date. But what if you want to remove a submodule? I found that it isn’t exactly an elegant process, but after some googling, this is what you should do:

  1. In your project’s root path, nano .gitmodules and delete any references to that sub-module.
  2. nano .git/config and do the same.
  3. Run git rm –cached /LOCATION/SUB_MODULE_FOLDER 
  4. Run git commit to commit any untracked stuff.
Advertisements
This entry was posted in General and tagged , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s