我正在使用 git 版本 1.5.6.3,并且 git 似乎没有注意到文件夹模式的更改
#create a test repository with a folder with 777 mode
:~$ mkdir -p test/folder
:~$ touch test/folder/dummy.txt
:~$ cd test
:~/test$ chmod 777 folder/
#init git repository
:~/test$ git init
Initialized empty Git repository in ~/test/.git/
:~/test$ git add .
:~/test$ git commit -m 'commit a directory'
Created initial commit 9b6b21a: commit a directory
0 files changed, 0 insertions(+), 0 deletions(-)
create mode 100644 folder/dummy.txt
#change folder permission to 744
:~/test$ chmod 744 folder/
:~/test$ git status
# On branch master
nothing to commit (working directory clean)
什么是04000
代表?
:~/test$ git ls-tree HEAD folder
040000 tree 726c1d5f0155771348ea2daee6239791f1cd7731 folder
这是正常行为吗?
如何跟踪文件夹模式更改?
唯一的“权限”位git
Tracks 是文件的可执行位,其余模式位描述每个 git 树中的对象是什么类型的文件系统对象。git
支持文件和符号链接(blob)、目录(树)和子模块(提交)。
git
旨在帮助跟踪不同机器上的源代码。权限位取决于计算机之间的用户和组映射。在不存在这些映射的分布式环境中,跟踪权限位通常最终会阻碍事情而不是帮助任何事情。
如果您需要跟踪更多文件系统属性,那么什么git
您可以考虑使用本地跟踪和扩展工具,例如等等管理员 http://kitenet.net/~joey/code/etckeeper/.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)