2015-08-20 62 views
0

維護我點文件設置在Github上:https://github.com/ronakg/dotfiles不能添加未追蹤git的子模塊用於提交

我用病原保持VIM插件和它們作爲git的子模塊添加到我的回購協議。

今天我添加了vim-startify作爲子模塊,我承諾進行更改。但它仍然顯示爲未跟蹤文件。

我試過git add -A但這也沒有工作。

$ git status 
On branch master 
Your branch is up-to-date with 'origin/master'. 
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: vim/bundle/vim-startify (untracked content) 

no changes added to commit (use "git add" and/or "git commit -a") 
+1

您可能被消息「未跟蹤內容」誤導。實際上,這意味着子模塊被跟蹤,但其文件夾包含一個或多個未跟蹤的文件,可能是已生成的/臨時文件等等......運行''git submodule foreach git status''來查看哪些文件未被跟蹤在你所有的子模塊中。 –

+0

謝謝。我能夠使用'git submodule foreach git status'找到未跟蹤的文件。請發佈這個答案,以便我可以接受它。 – ronakg

回答

2

您可能被消息(untracked content)誤導。實際上,這意味着該子模塊被跟蹤,但其文件夾包含一個或多個未跟蹤的文件,可能已經生成的東西/臨時文件等等...

要查看哪些文件未跟蹤到所有子模塊,請運行

git submodule foreach git status 
0

進入子模塊並整理其狀態 - 未跟蹤的內容在那裏,而不是在您的父回購中。