1.首先:给项目添加子模块 git submodule add 出现 already exists and is not a valid git repo
git submodule add http://XXXXXXXXXXXXXXX.git 'XXXXXX/XXXXXX/XXXXXX/' (目录名称) already exists and is not a valid git repo
说明目录已经存在,删除该目录,然后重试此命令
2.其次:继续
git submodule add http://XXXXXXXXXXXXXXX.git 'XXXXXX/XXXXXX/XXXXXX/'
The following path is ignored by one of your .gitignore files:
XXXXXX/XXXXXX/XXXXXX/
Use -f if you really want to add it.
- git submodule add -f http://XXXXXXXXXXXXXXX.git 'XXXXXX/XXXXXX/XXXXXX/'
(注意选定目录前面没有/ ,否则会出错)
如果出现:fatal: not a git repository cd当相关目录直接git init 继续执行1,2,3的操作
网友评论