当我运行
有没有一种方法可以显示这些文件只更改了它们的权限(模式),而不是它们的内容?我想输出应该像这样:
git status
命令时,许多文件被修改:$ git status
On branch feature-branch
Your branch is up to date with 'origin/feature-branch'.
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: file1.txt
modified: file2.txt
modified: file3.txt
...
有没有一种方法可以显示这些文件只更改了它们的权限(模式),而不是它们的内容?我想输出应该像这样:
$ git status
On branch feature-branch
Your branch is up to date with 'origin/feature-branch'.
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: file1.txt (100644 → 100755)
modified: file2.txt (100644 → 100755)
modified: file3.txt (100644 → 100755)
...
我知道 git diff
会显示像这样的内容:
diff --git file1.txt
old mode 100644
new mode 100755
但我更希望 git status
直接显示这个。
注意:虽然这个问题看起来很相似,但在那种情况下,git status
根本没有检测到模式更改。而在我的情况下,文件被标记为已修改,但我想区分纯文件编辑(修改内容)和只是更改权限的情况。