我无法通过 Git 将以下子模块推送到 Github。我看到以下错误消息。我做错了什么?
我按照以下步骤操作:
cd my_project
git init
git add *
git status
然后它将消息显示为:
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
(commit or discard the untracked or modified content in submodules)
modified: server/auth (modified content)
no changes added to commit (use "git add" and/or "git commit -a")
在我推送之后,我的子文件夹 server/auth 不会进入我的 github 存储库,请帮助我,我是新手: 我的项目结构如下: Server 作为主要模块,clients、resource 和 auth 作为子模块,除了“auth>”一切都在 promise 。
最佳答案
您对 Git 子模块 的定义是什么?当我查看您的 4 个步骤时,在我看来,您创建了一个新的 Git 存储库,其中包含几个子文件夹但没有 git 子模块?
如果您想为 clients、resource 和 auth 添加 git 子模块,您可能会这样做:
cd my_project
git init
git submodule add <global-path-to-sub-repository> **clients**
git submodule add <global-path-to-sub-repository> **resource**
git submodule add <global-path-to-sub-repository> **auth**
git submodule init
git add *
git status
关于git - 无法在 Git 中添加子模块,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31376008/