当Git(我认为是1.6.x发布版)意识到子模块内部的变化时。这只会让我烦恼:
$ git status vendor | grep modified:
# modified: vendor/rails (modified content)
$ git diff vendor/
diff --git a/vendor/rails b/vendor/rails
--- a/vendor/rails
+++ b/vendor/rails
@@ -1 +1 @@
-Subproject commit 046c900df27994d454b7f906caa0e4226bb42b6f
+Subproject commit 046c900df27994d454b7f906caa0e4226bb42b6f-dirty
请让它停下来?
发布于 2018-03-26 13:31:59
甚至有可能为.gitModule文件中添加的每个子模块设置忽略模式。
就在今天,我遇到了这个问题,在找到解决方案后,我立即在博客上写了一篇文章:如何忽略git子模块中的更改
它的主旨是:
一旦添加了子模块,就会有一个名为
.gitmodules
在存储库的根中
只需加一行.gitmodules
档案:
[submodule "bundle/fugitive"]
path = bundle/fugitive
url = git://github.com/tpope/vim-fugitive.git
ignore = dirty
发布于 2018-03-26 14:38:56
ignore = dirty
因此git 1.7.2已经退出,并包括--ignore-submodules
可供选择的status
.
从git help status
:
--ignore-submodules[=<when>]
Ignore changes to submodules when looking for changes.
<when> can be either "untracked", "dirty" or "all", which
is the default. 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).
我想要的价值是dirty
.
git status --ignore-submodules=dirty
我使用化名是因为我懒惰:
alias gst='git status --ignore-submodules=dirty'
https://stackoverflow.com/questions/-100007783
复制相似问题