OK. So I thought I had this licked ... but now ....
I have a project which includes one small library from GitHub as a submodule. In the original version of that super-p
I had this problem (flaky network so I got dropped submodule checkout like this) and I solved it by making this script (named it git-submodule-fix
so I could run it as git submodule-fix
)
#!/bin/bash
for arg
do
echo $arg
find . -name "`basename $arg`" | grep "$arg\$" | xargs rm -fr
done
If you get this i.e. from a git submodule update
fatal: Needed a single revision
Unable to find current revision in submodule path 'some/submodule/path'
do
git submodule-fix some/submodule/path
git submodule update