2010-10-05 86 views
1

我添加了兩個子模塊到我的VIM庫,並通過git status命令總是輸出這樣的:Git的子模塊和狀態隊列

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 

我已經運行:

git submodule init 
git submodule update 
git add . 

,並沒有任何反應讓它消失。有任何想法嗎?

回答

3

這可能是由於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加入這個選項)

+0

我讓Git 1.7.0.4當我鍵入git的狀態 - 忽略子模塊我得到一個錯誤。也man git status沒有列出你上面的內容... – dougvk 2010-10-05 07:13:32

+0

@doug是的,這隻適用於更新的版本。看我的編輯。 – 2010-10-05 07:20:10