git提交中包含文件权限和所有者:组属性? [英] Are file permissions and owner:group properties included in git commits?

查看:646
本文介绍了git提交中包含文件权限和所有者:组属性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

git提交中包含文件权限和所有者:组属性?
文件和目录的这些属性在整个git管道中如何处理[commit,push,pull,merge等]?

解决方案

Git中的文件分配为644(所有者 rw - ,组和其他 r - )或755(所有者 rwx ,组和其他 rx )。所有权信息未被存储。



这是故意的,并由这篇文章
$ b


其实在很早的时候,git用来记录blob的全部(mode& 0777)


一旦人们开始使用git,每个人都意识到它有一个非常不愉快的副作用,即产生的树依赖于用户的umasks
,因为一个人用模式664记录blob,而下一个用
修改文件的人将用模式644记录下来,并且它使
非常难以记录对源代码有意义的改变。这个问题很久以前用提交e447947修正了
(关于文件
mode bits,2005-04-16更加自由)。



Are file permissions and owner:group properties included in git commits? How are these properties of files and directories handled throughout the git pipeline [commit, push, pull, merge, etc] ?

解决方案

Files in Git are assigned either 644 (owner rw-, group and other r--) or 755 (owner rwx, group and other r-x). Ownership information is not stored.

This is deliberate, and well-explained by this post by Git's maintainer, Junio Hamano:

Actually in a very early days, git used to record the full (mode & 0777) for blobs.

Once people started using git, everybody realized that it had a very unpleasant side effect that the resulting tree depended on user's umasks, because one person records a blob with mode 664 and the next person who modifies the file would record with mode 644, and it made it very hard to keep track of meaningful changes to the source code. This issue was fixed long time ago with commit e447947 (Be much more liberal about the file mode bits., 2005-04-16).

这篇关于git提交中包含文件权限和所有者:组属性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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