为什么git创建只读(444)文件? [英] Why is git creating read-only (444) files?

查看:140
本文介绍了为什么git创建只读(444)文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用共享库(core.sharedRepository = group),我们遇到了一些git创建只读(权限444)文件的问题。无论我在哪玩弄git config项目,似乎都会在我们推送时在服务器端创建一些只读元数据。这些文件位于.git /中(或者是裸机中的对象)。

Using a shared repo (core.sharedRepository=group) we ran into some issues with git creating read-only (permissions 444) files. No matter which git config items I twiddle there always seems to be some read-only meta-data created on the server side when we push. These files are in .git/ (or objects/ in a bare repo).

你真的不需要再次写入这些文件(不管你使用哪种git操作执行)?它们可能代表犯下的三角洲,所以真的不应该改变,但我希望有人可以澄清这一点。

Do you really never need to write to these files again (regardless of what git operations you perform)? They may be representative of commit deltas, so really should not be changed, but I was hoping someone could clarify this.

对于好奇,相关的行看起来是856和867的builtin / index-pack.c在git中。

For the inquisitive, the relevant lines look to be 856 and 867 of builtin/index-pack.c in git.

推荐答案

这些文件是对象数据库的一部分,只读。无论你使用Git做什么,一旦创建完成,就无法更改特定对象的内容

Those files are part of the object database, which really is read-only. No matter what you do with Git, you can't change the contents of a specific object once it has been created.

请注意,如果你退出一个提交并在它的位置创建一个新的提交,你将创建一个带有 new 标识符和 new 内容的 new 对象。 Git最终会执行垃圾回收来移除旧的未引用对象。

Note that if you back out a commit and create a new one in its place, you'll be creating a new object with a new identifier and new contents. Git will eventually perform its garbage collection to remove the old, unreferenced object(s).

这篇关于为什么git创建只读(444)文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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