新的文件模式100644这个100在这里。我知道最后三个数字的意思。但这个文件模式并不意味着。请告诉我所有关于。我喜欢被充分告知。
我尝试搜索此文件模式,但我只获得有关文件权限的信息,而不是此文件模式。
发布于 2022-03-30 05:29:04
根据git文档
该代码是以八进制表示的一系列位,从最大到最小。
因此,您的100644
示例转换为二进制
001 000 000 110 100 100
文件类型: 1000 -常规文件
未使用的比特数: 000
权限: 110 100 - 644
树似乎也得到没有权限的类型代码0100,尽管我没有在文档中看到这一点。
发布于 2022-03-30 06:06:10
Git树对象中的条目只能有五种不同的“文件模式”。例如,我当前的Git源代码包含了许多其他条目:
040000 tree fe75d26ce528361a9ef3063415db408a7a1ca189 Documentation
120000 blob 81052262e0e43711f308ebc67a371def932cdccc RelNotes
100755 blob 205541e0f7f81b1df4061215ae34a2742a45475d generate-cmdlist.sh
100644 blob a25940d72e84e1ad6daba76a6c2845f320bc4df3 git.c
160000 commit 855827c583bc30645ba427885caa40c5b81764d2 sha1collisiondetection
这些模式是
100644
100755
040000
120000
160000
Git的作者本可以选择任何文本标记来识别这五种模式,但出于历史原因,他们选择将它们写成与C代码中的st_mode
of a struct stat
中的值相同的值,以八进制值形式编写。这种任意选择的证明是,160000
值永远不会出现在struct stat
中(这将是S_IFDIR|S_IFLNK
,在行为良好的系统上是不可能的)。
发布于 2022-03-30 05:02:28
似乎filemode指的是可执行位(而不是所有权限)。
不建议使用core.fileMode。它只处理模式的可执行位,而不是读/写位。
根据吉特-康菲的文档
core.fileMode
Tells Git if the executable bit of files in the working tree is to be honored.
Some filesystems lose the executable bit when a file that is marked as executable is checked out, or checks out a non-executable file with executable bit on. git-clone[1] or git-init[1] probe the filesystem to see if it handles the executable bit correctly and this variable is automatically set as necessary.
A repository, however, may be on a filesystem that handles the filemode correctly, and this variable is set to true when created, but later may be made accessible from another environment that loses the filemode (e.g. exporting ext4 via CIFS mount, visiting a Cygwin created repository with Git for Windows or Eclipse). In such a case it may be necessary to set this variable to false. See git-update-index[1].
The default is true (when core.filemode is not specified in the config file).
https://stackoverflow.com/questions/71671690
复制相似问题