Github 部署失败-添加子模块问题-使用Netlify

Github 部署失败-添加子模块问题-使用Netlify,github,deployment,git-submodules,netlify,Github,Deployment,Git Submodules,Netlify,我正在尝试将我的站点部署到Netlify,当我尝试触发部署时,出现以下错误: 1:46:02 PM: Error checking out submodules: fatal: No url found for submodule path 'startbootstrap-grayscale' in .gitmodules 1:46:02 PM: Failing build: Failed to prepare repo 1:46:02 PM: failed during stage 'prep

我正在尝试将我的站点部署到Netlify,当我尝试触发部署时,出现以下错误:

1:46:02 PM: Error checking out submodules: fatal: No url found for submodule path 'startbootstrap-grayscale' in .gitmodules
1:46:02 PM: Failing build: Failed to prepare repo
1:46:02 PM: failed during stage 'preparing repo': Error checking out submodules: fatal: No url found for submodule path 'startbootstrap-grayscale' in .gitmodules
我的
文件夹
目录是我要部署的目录,这些是该目录中的内容

LICENSE             node_modules
README.md           package-lock.json
css                 package.json
gulpfile.js         scss
img                 startbootstrap-grayscale
index.html          vendor
js
如您所见,错误指向
startbootstrap grayscale
目录

在这个
startbootstrap grayscale
目录中,上面看到的所有内容都在同一个目录中。(不确定我在那里做了什么才让这一切发生)。如果我
cd
进入第二个
startbootstrap grayscale
目录,它里面什么都没有

我被告知需要添加git子模块,但不确定还要添加什么才能解决此问题

git子模块add-f
询问更多信息:

usage: git submodule [--quiet] add [-b <branch>] [-f|--force] [--name <name>] [--reference <repository>] [--] <repository> [<path>]
   or: git submodule [--quiet] status [--cached] [--recursive] [--] [<path>...]
   or: git submodule [--quiet] init [--] [<path>...]
   or: git submodule [--quiet] deinit [-f|--force] (--all| [--] <path>...)
   or: git submodule [--quiet] update [--init] [--remote] [-N|--no-fetch] [-f|--force] [--checkout|--merge|--rebase] [--[no-]recommend-shallow] [--reference <repository>] [--recursive] [--] [<path>...]
   or: git submodule [--quiet] summary [--cached|--files] [--su mmary-limit <n>] [commit] [--] [<path>...]
   or: git submodule [--quiet] foreach [--recursive] <command>
   or: git submodule [--quiet] sync [--recursive] [--] [<path>...]
   or: git submodule [--quiet] absorbgitdirs [--] [<path>...]
用法:git子模块[--quiet]添加[-b][-f |--force][--name][--reference][--]
或者:git子模块[--quiet]状态[--cached][--recursive][--][…]
或者:git子模块[--quiet]init[--][…]
或者:git子模块[--quiet]deinit[-f |--force](-all |[--])
或者:git子模块[--quiet]更新[--init][--remote][N |--no fetch][f |--force][--checkout |--merge |--rebase][--[no-]建议浅层][--reference][--recursive][--]
或者:git子模块[--quiet]摘要[--cached |--files][--summary limit][commit][--][…]
或者:git子模块[--quiet]foreach[--recursive]
或:git子模块[--quiet]同步[--recursive][--][…]
或者:git子模块[--quiet]absorbgitdirs[--][…]

关于如何添加以解决此问题的建议?感谢您的帮助。

我以前在不同的项目中遇到过类似的问题。我的解决方案通常是解耦子模块并将代码移动到我的代码库中(或者为此使用托管包)

要将模块解耦到子模块文件夹中,请删除
.git
文件夹并将文件添加到git存储库中。在命令行中,我会这样做:

// going into the submodule - might need to tweaked, depending on the exact path
cd startbootstrap-grayscale

// delete the git submodule
rm -rf .git

// going out of the directory
cd ..

// adding everything to git
git add .

通过这些步骤(以及可能对路径进行的细微调整),我已经能够为自己解决这个问题。

我能够解决这个问题,我需要使用
rm-r startbootstrap grayscale
并推动更改,以摆脱我的
startbootstrap grayscale
文件夹。出于某种原因,我有太多相同类型的嵌套文件夹

完全取消我的git目录,然后重新开始一个新的git提交,这对我很有效。不太理想,但我试图摆脱git子模块,但没有成功。现在我的网站是活的


好的,我按照你写的做了,在我做了git添加之后,我尝试提交并推送它,但它只是说工作树都是最新的,我应该把所有内容推送到github,对吧?我的startbootstrap灰度文件夹不能点击我的github。知道有什么问题吗?好的。酷
rm -rf .git
git init
git remote add origin YOUR_URL
git add .
git commit -m 'restart history'
git push origin master