Git Submodules. Pulling into a new clone of the super-project

前端 未结 6 584
迷失自我
迷失自我 2021-01-30 03:35

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

6条回答
  •  遥遥无期
    2021-01-30 04:31

    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
    

提交回复
热议问题