1

I've changed some database settings in a project and can't commit the DB file. It doesn't even show up as modified. This codebase is copied from another Craft site I built, which a new repository was created for. It is running Craft CMS 2.6.2903.

$ git add craft/config/db.php
fatal: Pathspec 'craft/config/db.php' is in submodule 'craft/config'

fatal: no submodule mapping found in .gitmodules for path 'craft/config'

There's no .gitmodules file in the repo (or in any of my other Craft sites) and it doesn't make sense for the DB file or the other config files to be in a submodule.

I'm really confused now as I can't even find a relevant reference to that submodule in the .git folder.

grep -ro "craft/config" .
Binary file ./index matches

Given I can't find it I'm not sure what to do next.

JamesNZ
  • 482
  • 5
  • 17

1 Answers1

2

It is possible that craft/config folder is actually a gitlink (special entry in the index recording a SHA1 for a submodule)

Check the output of git ls-tree HEAD craft/config (no trailing /)

The fix is simple git rm --cached craft/config (again: no trailing /)

Then you can add again craft/config.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250