Copyright (c) 2011 Doron Katz. All rights reserved. DoronKatz registered under ABN 68 954 062 611. Apple, the Apple logo, iPod, iPod touch, and iTunes are trademarks of Apple Inc., registered in the U.S. and other countries. iPhone is a trademark of Apple Inc. App Store is a service mark of Apple Inc. Theme by Cory Watilo

Filed under: Git

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.