Sub module

Notes on submodules A great way to split up a project into smaller modules


  • Adding a submodule:
    git submodule add Packages/Remote/UserDefaultsSugar/

Editing existing

  1. Delete the folder with the submodule
  2. Delete ref in .submodules and Delete ref in .git/.config (⚠️️ This part can sometimes be skipped ⚠️️)
  3. force add with: git submodule add --force Packages/Remote/With/

Resetting submodule

Sometimes editing or changing a submodule just creates an avalanche of issues. So resetting is a better option

  1. compress your project, to back it up
  2. git reset --hard
  3. Add submodules ✨


  • updating submodules: git submodule update --remote