在开始之前,我应该说我已经看过this post和this one了,但出于某种原因,如果解决方案对我没有用的话。我的存储库在~/sources
下,所以每个命令都是从该路径运行的。这就是我所做的:
将文件更改为false:
$ git config --global core.filemode false
检查全局配置:
$ git config --list
...
core.filemode=false
core.repositoryformatversion=0
core.bare=false
core.logallrefupdates=true
...
重新初始化存储库:
$ git init
Reinitialized existing Git repository in /home/rperez/sources/.git/
检查所需添加的内容是否已提交:
$ git status
我得到了一个列表,其中包含了存储库中的所有文件。
我正在使用:
$ git --version
git version 2.9.3
更新:为两个不同的文件添加了git
$ git status
...
modified: testing/test-valid-swasset-update.php
...
Untracked files:
(use "git add <file>..." to include in what will be committed)
library/mpdf60/ttfontdata/dejavusanscondensedI.GDEFdata.php
...
来自上述文件的git diff
输出:
$ git diff testing/test-valid-swasset-update.php
diff --git a/testing/test-valid-swasset-update.php b/testing/test-valid-swasset-update.php
old mode 100755
new mode 100644
我在这里错过了什么?
发布于 2016-12-13 14:52:16
本地配置覆盖全局配置设置。
问题中的diff输出指示本地git配置将filemode
设置为true。这可能是预期的行为,因为为回购创建的默认配置定义如下:
-> git init
Initialized empty Git repository in /tmp/foo/.git/
-> cat .git/config
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
更改filemode
的全局配置不会影响这一点,因此实际上git config --global core.filemode false
不会做任何事情,因为它总是在本地被覆盖。
因此,若要更改此回购的文件,请更改本地配置:
$ git config core.filemode false
$ git config core.filemode
false
考虑到this question/answer,它有一种可能会起作用,尽管对我来说不是这样。
发布于 2016-12-13 21:03:06
您可以通过以下内容验证本地设置: git config --local
...and设置如下所示的本地值:
git配置--本地core.filemode false
https://stackoverflow.com/questions/41123313
复制相似问题