首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >GIT:我可以禁止在状态、差异等中列出“修改后的内容”/脏子模块条目吗?

GIT:我可以禁止在状态、差异等中列出“修改后的内容”/脏子模块条目吗?
EN

Stack Overflow用户
提问于 2018-03-26 05:15:03
回答 2查看 0关注 0票数 0

当Git(我认为是1.6.x发布版)意识到子模块内部的变化时。这只会让我烦恼:

代码语言:txt
复制
$ git status vendor | grep modified:
#       modified:   vendor/rails (modified content)
代码语言:txt
复制
$ 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

请让它停下来?

EN

Stack Overflow用户

发布于 2018-03-26 14:38:56

代码语言:txt
复制
ignore = dirty

因此git 1.7.2已经退出,并包括--ignore-submodules可供选择的status.

git help status:

代码语言:txt
复制
--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.

代码语言:txt
复制
git status --ignore-submodules=dirty

我使用化名是因为我懒惰:

代码语言:txt
复制
alias gst='git status --ignore-submodules=dirty'
票数 0
EN
查看全部 2 条回答
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/-100007783

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档