GLOB
Montagne, Informatique & Pensées...

Git Fatal Error

publié le 05/02/2015

Even though many of my customers don't even know what a versionning system is, I like to work with them. So, I end up initing projects only on my local workstation. That allows me export only the modified files without being forced to remember the modified files and the modification made.

On my latest project, I did what I always do :

git init
git add --all
git commit -m "Initial commit"

And I ended up with the following message :

fatal: bad object HEAD
fatal: 'git status --porcelain' failed in submodule modules/xxxx

WTF !!!
I had absolutely no idea what the problem was. I googled, stackoverflowed and searched for a solution all over the web. You will have to admit that the error was not very precise and informative. I thought that the submodule the message was talking about was a git submodule.

Finnaly, a flash of intelligence made me realize that it was a module of my program (in Prestashop, the directory containing modules is called modules). This module had been developped using git and the production directory still contained the .git directory so my local git refused to commit anything or even to display a status of the repository.

Hope this will help.

git fatal-error submodule

Pourquoi un blog ?

Il me fallait bien entrer dans la modernité, après tout, un développeur sans blog, c'est comme un trailer sans pipette ça fait pas sérieux.

Je ne suis pas sûr que ce blog fera sérieux mais, si lecteur il y a, ce sera à eux d'en décider.


Powered by Jalmot