我已经安装了Cygwin(使用Cygwin软件包管理器)和 Windows 的 Git Bash。
我刚刚使用Cygwin shell克隆了一个仓库,然后在仓库的根目录中打开了Git Bash shell和Cygwin shell。
然后我从每个shell中执行git status
。Git Bash发现了一个更改(文件权限),但是Cygwin没有发现,我正在尝试理解其中的原因。
以下是详细信息:
Git Bash(显示修改文件)
$ git --version
git version 2.23.0.windows.1
$ git status
On branch master
Your branch is up to date with 'origin/master'.
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: script.sh
no changes added to commit (use "git add" and/or "git commit -a")
$ git diff
diff --git a/script.sh b/script.sh
old mode 100755
new mode 100644
$ git config -l | grep core
core.symlinks=true
core.autocrlf=false
core.fscache=true
core.editor='C:\Program Files (x86)\Notepad++\notepad++.exe' -multiInst -notabbar -nosession -noPlugin
core.editor='C:/Program Files (x86)/Notepad++/notepad++.exe' -multiInst -nosession
core.autocrlf=false
core.preloadindex=true
core.fscache=true
core.filemode=true
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
core.ignorecase=true
Cygwin(未发现更改)
$ git --version
git version 2.21.0
$ git status
On branch master
Your branch is up to date with 'origin/master'.
nothing to commit, working tree clean
$ git config -l | grep core
core.editor='C:/Program Files (x86)/Notepad++/notepad++.exe' -multiInst -nosession
core.autocrlf=false
core.preloadindex=true
core.fscache=true
core.filemode=true
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
core.ignorecase=true
因此,对于两个shell都设置core.filemode=true
。
有什么建议可以解释git bash为什么能够检测到文件权限的更改吗?