【发布时间】:2020-02-07 18:01:59
【问题描述】:
当我运行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 已经向我展示了这个,我会更喜欢。
注意:This question 看起来很相似,但在这种情况下,git status 根本没有检测到模式更改。就我而言,文件被标记为已修改,但我想将纯文件编辑(修改内容)与仅更改权限区分开来。
【问题讨论】:
-
不是,我在问题中添加了注释。
标签: git