开发者

Git submodules and the status queue

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?


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)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜