gpt4 book ai didi

git - 无法在 Git 中添加子模块

转载 作者:太空狗 更新时间:2023-10-29 13:46:59 26 4
gpt4 key购买 nike

我无法通过 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 作为主要模块,clientsresourceauth 作为子模块,除了“auth>”一切都在 promise 。

最佳答案

您对 Git 子模块 的定义是什么?当我查看您的 4 个步骤时,在我看来,您创建了一个新的 Git 存储库,其中包含几个子文件夹但没有 git 子模块?

如果您想为 clientsresourceauth 添加 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/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com