Posted on
Gitmodules & Drupal 9

Gitmodules - Git Sub Modules - are really the bane of my life! The recent Drupal 9 update has brought this into sharp focus and pushed us to find a better way of dealing with these. Here is a recipe...

 

Delete the .git folder of the submodule with the following
------------------------------------------
rm -rf public_html/modules/contrib/module_name/.git

rm cached it out of there with this:
-------------------------------------------
git rm --cached public_html/modules/contrib/module_name

-remove the directory from the main git repo
--------------------------------------------
rm -rf .git/modules/public_html/modules/contrib/module_name

re-add module explicitly
---------------------------------------------
Submodule of module_name module should now be untracked so we can add it as files and directory as part of this local repository.
git add public_html/modules/contrib/module_name

Commit the changes
------------------------------------------------

A piece of cake - just follow these detailed steps for each pesky gitmodule you have and you will be free - probably.

Tags

Add new comment

Request a Free Quotation

Your Name