So I just had this weird git submodule error and I thought I would write up the quick solution a coworker gave me.
My project has a submodule called “tools” and I was trying to update it using:
git submodulate update --init --recursive
This was giving me the following error:
Submodule 'tools' () registered for path 'tools'
Well, that wasn’t good. I also don’t know what this means. I’m sure someone smarter than me can explain what it means, but I was just trying to update my submodules to pull in the latest changes a coworker had made.
I tried a lot of other various things, maybe just git submodule update –init ? Nope. Maybe git submodule –init ? Nope. Tried Googling. Nothing. And then I asked my coworkers and Ryan Nagle had a very simple solution:
rm -Rf tools
git submodule update --init --recursive
This deletes the tools directory and then just updates the submodules I’m supposed to have. Voila, I’ve got the new one! An easy solution to a quick problem. And as I don’t blog often enough, I’m going to try to start posting more of these solutions more often.