如果我有一个存储库,可以在其中添加新的子目录并对文件进行更改,当我运行git status时,我会看到一个摘要
$ 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时,它将显示所有文件名,包括新目录中的文件名:
$ 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 +++++++++++++++++++++++++++++++
37 files changed, 1683 insertions(+), 7 deletions(-)有没有办法对另一个看起来与diff --stat输出类似的分支执行git status?换句话说,我希望看到:
$ 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(-)如果另一个分支不包含目录,只需列出目录,而不是它的所有文件和子目录。
发布于 2019-08-18 19:03:06
你可能需要结合:
git diff --stat --summary . (请注意当前文件夹的<space dot>)git diff --dirstat我还没有看到一种将两者结合在一起的方法。
https://stackoverflow.com/questions/57547454
复制相似问题