git解决无法正常添加个别submodule

来源:互联网 发布:c语言 fprintf 编辑:程序博客网 时间:2024/06/06 01:54

由于我的一番瞎操作,导致工作的git库里有一个submodule子库无法正常添加,总是有如下提示:

A git directory for 'APP/CommonLibrary' is found locally with remote(s):  origin        git@github.com:FiveRingWind/CommonLibrary.gitIf you want to reuse this local git directory instead of cloning again from  git@github.com:FiveRingWind/CommonLibrary.gituse the '--force' option. If the local git directory is not the correct repoor you are unsure what this means choose another name with the '--name' option.

emmmm,怎么也添加不上,很烦….
然后一番搜索….解决问题…. :)
之前用的语句是:

 git submodule add git@github.com:世界上最厉害的公司/CommonLibrary.git ./APP/CommonLibrary

貌似是因为库里本省是有一个同名的子库的,只是我把它删了…但是导致重新添加子库添加不上…so….
改成如下语句:

git submodule add --name Common git@github.com:世界上最厉害的公司/CommonLibrary.git ./APP/CommonLibrary 

完工~

原创粉丝点击