首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >git diff只显示目录,而不是所有新文件。

git diff只显示目录,而不是所有新文件。
EN

Stack Overflow用户
提问于 2019-08-18 18:50:13
回答 1查看 146关注 0票数 4

如果我有一个存储库,可以在其中添加新的子目录并对文件进行更改,当我运行git status时,我会看到一个摘要

代码语言:javascript
复制
$ git status
On branch test
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)

        modified:   composer.json
        modified:   composer.lock
        modified:   vendor/composer/autoload_psr4.php
        modified:   vendor/composer/autoload_static.php
        modified:   vendor/composer/installed.json

Untracked files:
  (use "git add <file>..." to include in what will be committed)

        modules/contrib/a11y_paragraphs_tabs/
        vendor/jakubsuchy/

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

当我添加和提交这些文件,然后执行git diff --stat master时,它将显示所有文件名,包括新目录中的文件名:

代码语言:javascript
复制
$ git diff --stat master
 composer.json                                                                                             |   5 +-
 composer.lock                                                                                             | 207 ++++++++++++++++++++++++++++++++-
 modules/contrib/a11y_paragraphs_tabs/LICENSE.txt                                                          | 339 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 modules/contrib/a11y_paragraphs_tabs/README.md                                                            |  88 ++++++++++++++
 modules/contrib/a11y_paragraphs_tabs/a11y_paragraphs_tabs.info.yml                                        |  14 +++
 modules/contrib/a11y_paragraphs_tabs/a11y_paragraphs_tabs.install                                         |  33 ++++++
 modules/contrib/a11y_paragraphs_tabs/a11y_paragraphs_tabs.libraries.yml                                   |  17 +++
 modules/contrib/a11y_paragraphs_tabs/a11y_paragraphs_tabs.module                                          |  46 ++++++++
 .../config/optional/core.entity_form_display.paragraph.a11y_paragraphs_tab_content.default.yml            |  25 ++++
 .../config/optional/core.entity_form_display.paragraph.a11y_paragraphs_tabs_panel.default.yml             |  39 +++++++
 .../config/optional/core.entity_form_display.paragraph.a11y_paragraphs_tabs_wrapper.default.yml           |  39 +++++++
 .../config/optional/core.entity_view_display.paragraph.a11y_paragraphs_tab_content.default.yml            |  21 ++++
 .../config/optional/core.entity_view_display.paragraph.a11y_paragraphs_tabs_panel.default.yml             |  32 ++++++
 .../config/optional/core.entity_view_display.paragraph.a11y_paragraphs_tabs_wrapper.default.yml           |  32 ++++++
 .../config/optional/field.field.paragraph.a11y_paragraphs_tab_content.field_a11y_para_tabs_text_area.yml  |  20 ++++
 .../config/optional/field.field.paragraph.a11y_paragraphs_tabs_panel.field_a11y_para_tabs_tab_content.yml |  36 ++++++
 .../config/optional/field.field.paragraph.a11y_paragraphs_tabs_panel.field_a11y_para_tabs_tab_title.yml   |  20 ++++
 .../config/optional/field.field.paragraph.a11y_paragraphs_tabs_wrapper.field_a11y_para_tabs_sec_title.yml |  20 ++++
 .../optional/field.field.paragraph.a11y_paragraphs_tabs_wrapper.field_a11y_para_tabs_tabs_panel.yml       |  33 ++++++
 .../a11y_paragraphs_tabs/config/optional/field.storage.paragraph.field_a11y_para_tabs_sec_title.yml       |  19 +++
 .../a11y_paragraphs_tabs/config/optional/field.storage.paragraph.field_a11y_para_tabs_tab_content.yml     |  19 +++
 .../a11y_paragraphs_tabs/config/optional/field.storage.paragraph.field_a11y_para_tabs_tab_title.yml       |  19 +++
 .../a11y_paragraphs_tabs/config/optional/field.storage.paragraph.field_a11y_para_tabs_tabs_panel.yml      |  19 +++
 .../a11y_paragraphs_tabs/config/optional/field.storage.paragraph.field_a11y_para_tabs_text_area.yml       |  18 +++
 .../a11y_paragraphs_tabs/config/optional/paragraphs.paragraphs_type.a11y_paragraphs_tab_content.yml       |   8 ++
 .../a11y_paragraphs_tabs/config/optional/paragraphs.paragraphs_type.a11y_paragraphs_tabs_panel.yml        |   8 ++
 .../a11y_paragraphs_tabs/config/optional/paragraphs.paragraphs_type.a11y_paragraphs_tabs_wrapper.yml      |   8 ++
 modules/contrib/a11y_paragraphs_tabs/css/a11y-paragraphs-tabs.css                                         | 162 ++++++++++++++++++++++++++
 modules/contrib/a11y_paragraphs_tabs/js/a11y-paragraphs-tabs.js                                           |   6 +
 modules/contrib/a11y_paragraphs_tabs/templates/field--field-a11y-para-tabs-tabs-panel.html.twig           |   3 +
 modules/contrib/a11y_paragraphs_tabs/templates/paragraph--a11y-paragraphs-tabs-wrapper.html.twig          | 131 +++++++++++++++++++++

mules/cont肋骨/nasa\1+卖主/composer/autoload_psr4.php\\x{e76f}\\x{e76f}\\x{e76f}\{e76f}\\{e76f}\x{e76f}\\{e76f}\x{e76f}\\{e76f}5+供应商/作曲家/installed.json/ 195 +++++++++++++++++++++++++++++++

代码语言:javascript
复制
 37 files changed, 1683 insertions(+), 7 deletions(-)

有没有办法对另一个看起来与diff --stat输出类似的分支执行git status?换句话说,我希望看到:

代码语言:javascript
复制
$ git diff --stat --summary? master
 composer.json                                         |   5 +-
 composer.lock                                         | 207 ++++++++++++++++++++++++++++++++-
 modules/contrib/a11y_paragraphs_tabs/                 |   some other stat here indicating files
 vendor/composer/autoload_psr4.php                     |   1 +
 vendor/composer/autoload_static.php                   |   5 +
 vendor/composer/installed.json                        | 195 +++++++++++++++++++++++++++++++
 37 files changed, 1683 insertions(+), 7 deletions(-)

如果另一个分支不包含目录,只需列出目录,而不是它的所有文件和子目录。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-08-18 19:03:06

你可能需要结合:

  • git diff --stat --summary . (请注意当前文件夹的<space dot>)
  • 其他文件夹的git diff --dirstat

我还没有看到一种将两者结合在一起的方法。

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/57547454

复制
相关文章

相似问题

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