【发布时间】:2020-01-21 05:37:44
【问题描述】:
我已经安装了 cygwin(以及使用 cygwin 包管理器的 git)和用于 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 获取文件权限更改的任何建议?
【问题讨论】: