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.

3
  • Hi James... Despite the fact that you're using Craft, this is very much a git question. Craft itself doesn't contain anything git related by default. For that reason, we'll migrate this to Stack Overflow. Commented Aug 8, 2016 at 3:45
  • Hi Lindsey. Quite right. Thanks for that. Commented Aug 8, 2016 at 4:13
  • Is there a .git file in craft/config/? Commented Aug 8, 2016 at 5:50

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.