2010-10-05 6 views
1

J'ai ajouté deux sous-modules à mon dépôt de vim, et la commande git status sorties toujours ceci:sous-modules Git et la file d'attente d'état

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 

J'ai couru:

git submodule init 
git submodule update 
git add . 

et rien ne se passe à faites-le partir. Des idées?

Répondre

3

Ceci est probablement dû à une modification ajoutée dans git-1.7.0 par laquelle les sous-modules sont marqués comme s'ils contiennent des fichiers modifiés ou non.

git status a une option --ignore-submodules pour ignorer des modifications spécifiques. De 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). 

(cette option n'a été ajoutée à git-1.7.2)

+0

Je git 1.7.0.4 et quand je tape git status --ignore-je obtenir une sous-modules erreur. De plus, le statut de man git ne liste pas ce que vous avez ci-dessus ... – dougvk

+0

@doug Oui, ceci n'est disponible que dans les versions plus récentes. Voir ma modification. –