Git 子模块和状态队列

发布于 2024-09-26 06:35:52 字数 456 浏览 2 评论 0原文

我向我的 vim 存储库添加了两个子模块,并且 git status 命令总是输出这样的内容:

On branch master
Changed but not updated:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)

   modified:   bundle/snipmate
   modified:   bundle/yankring

I've run:

git submodule init
git submodule update
git add .

并且没有发生任何事情让它消失。有什么想法吗?

I added two submodules to my vim repository, and the git status command always outputs this:

On branch master
Changed but not updated:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)

   modified:   bundle/snipmate
   modified:   bundle/yankring

I've run:

git submodule init
git submodule update
git add .

and nothing happens to make it go away. Any ideas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

随风而去 2024-10-03 06:35:52

这可能是由于 git- 中添加的更改所致1.7.0 如果子模块包含已修改或未跟踪的文件,则子模块将被标记为

git status 有一个选项 --ignore-submodules 来忽略特定的更改。来自 man git-status:(

--ignore-submodules[=<when>]
              Ignore changes to submodules when looking for changes. <when>
              can be either "none", "untracked", "dirty" or "all", which is
              the default. Using "none" will consider the submodule modified
              when it either contains untracked or modified files or its HEAD
              differs from the commit recorded in the superproject and can be
              used to override any settings of the ignore option in git-
              config(1) or gitmodules(5). When "untracked" is used submodules
              are not considered dirty when they only contain untracked
              content (but they are still scanned for modified content).
              Using "dirty" ignores all changes to the work tree of
              submodules, only changes to the commits stored in the
              superproject are shown (this was the behavior before 1.7.0).
              Using "all" hides all changes to submodules (and suppresses the
              output of submodule summaries when the config option
              status.submodulesummary is set).

此选项仅在 git-1.7.2)

This probably is due to a change added in git-1.7.0 by which submodules become marked as dirty if they contain modified or untracked files.

git status has an option --ignore-submodules to ignore specific changes. From man git-status:

--ignore-submodules[=<when>]
              Ignore changes to submodules when looking for changes. <when>
              can be either "none", "untracked", "dirty" or "all", which is
              the default. Using "none" will consider the submodule modified
              when it either contains untracked or modified files or its HEAD
              differs from the commit recorded in the superproject and can be
              used to override any settings of the ignore option in git-
              config(1) or gitmodules(5). When "untracked" is used submodules
              are not considered dirty when they only contain untracked
              content (but they are still scanned for modified content).
              Using "dirty" ignores all changes to the work tree of
              submodules, only changes to the commits stored in the
              superproject are shown (this was the behavior before 1.7.0).
              Using "all" hides all changes to submodules (and suppresses the
              output of submodule summaries when the config option
              status.submodulesummary is set).

(this option was only added in git-1.7.2)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文