什么是git的“filemode”? [英] What is git's "filemode"?

查看:207
本文介绍了什么是git的“filemode”?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于每一个存在于 git 回购...的东西......那里肯定没有太多关于 FILEMODE 。谷歌的前100个响应都在这个地方,这个标题的问题没有被要求..所以在这里..什么是 filemode ?对我来说,它在每个回购的 ./git / config 文件中,靠近顶部,一个...

 [core] 
filemode = true

是吗?这是什么意思?它与

  bare = false 

其中我也没有真正得到...我使用 git 像一个疯子,并知道什么是一百万其他的混帐,恕我直言,任意炮制/半脑 配置参数做。 。但是不是这个......我确定这是一件简单的事情(也许和权限有关系,或者是战争触发了一个更改标志?),所以如果你知道如何操纵设置/以及什么效果。这将是很好的知道...

解决方案

一个git裸回购(在这里详细说明)与filemode没有任何关系。

用于推送到它,因为它没有工作树,所以不用担心维护工作树与你刚才推送的内容同步。


什么是假文件?什么构成工作目录?

没有假文件。这只是一个裸回购只包含git的管理和控制文件,而不是实际的数据文件,你可以使用和修改。

这些签出了一个工作目录,当回购没有光秃。



git config 手册页

  core.fileMode 

$ b


如果为false,则索引和工作树之间的可执行位差异被忽略;在破碎的文件系统上很有用,例如 FAT(文件分配表)

参见 git-update-index
$ b 该命令授予 core.filemode 配置变量。

如果您的存储库位于可执行位不可靠的文件系统上,则应将其设置为 false

这会导致命令忽略索引中记录的文件模式和文件系统上的文件模式之间的差异(如果它们仅在可执行位上不同)
在这样一个不幸的文件系统上,可能需要使用 git update-index --chmod =



对于我来说,它在每个回购的 ./git/config 文件中,靠近顶部,


我也是,但在Windows上,它始终是:

  git config --local core.filemode 
false

不要忘记那git只记录两个文件模式:


$ 644
$ 755

For something that exists in EVERY single git repo... on earth... there sure isn't very much info out there regarding filemode. The first 100 responses from google were all over the place, and a question with this' title handn't been asked.. so here goes.. What is filemode? For me, it's in every repo's ./git/config file, near the top, a lá...

 [core]
    filemode = true

What is it? What does it mean? Does it bear any relation to

    bare = false

which I also don't really get... I use git like a madman, and know what a million other of git's endless, and IMHO, arbitrarily concocted / half-brained config parameters do.. but not this one... I'm sure it's a simple thing (maybe related to permissions? or war triggers a change flag?), so if you know more about how to manipulate the setting / and to what effect.. that would be good to know...

A git bare repo (detailed here) has no relation with filemode.
It is used for pushing to it, because since it has no working tree, there is no concern about maintaining said working tree in sync with what you just pushed.

what is a "fake" file? and what constitutes a "working" directory?

There is no "fake" file. It is just that a bare repo only contains git's administrative and control files, not actual data file you could work with and modify.
Those are checked out in a "working directory", when the repo is not bare.

The git config man page

core.fileMode

If false, the executable bit differences between the index and the working tree are ignored; useful on broken filesystems like FAT (File Allocation Table).
See git-update-index.

The command honors core.filemode configuration variable.
If your repository is on a filesystem whose executable bits are unreliable, this should be set to false.
This causes the command to ignore differences in file modes recorded in the index and the file mode on the filesystem if they differ only on executable bit.
On such an unfortunate filesystem, you may need to use git update-index --chmod=.

For me, it's in every repo's ./git/config file, near the top,

Me too, but on Windows, it is always:

git config --local core.filemode
false

Don't forget that git only records two filemodes:

  • 644
  • 755

这篇关于什么是git的“filemode”?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆