在Windows上的Git和文件属性 [英] Git on Windows and file attributes

查看:263
本文介绍了在Windows上的Git和文件属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我注意到,当您在Windows环境中使用Git提交或签出文件时,文件属性不会被保留(例如隐藏或只读)。如果我提交一个隐藏的文件,然后在另一台计算机上查看它,则该文件不再隐藏。是否有可能使Git识别Windows文件属性?



谢谢。

解决方案

没有。 Git不会跟踪完整的UNIX权限,它只是为了方便而记住可执行位。至于为什么 - 这是一个版本控制系统,旨在主要跟踪源代码。这使得该功能彻底无用(更不用说'隐藏'属性也是无用的)。

I noticed that when you commit or checkout files using Git in a Windows environment, the file attributes are not preserved (for example hidden or read-only). If I commit a hidden file and then I check it out on another computer, the file is no more hidden. Is it possible to make Git recognize Windows file attributes?

Thanks.

解决方案

No. Git doesn't track full UNIX permissions either, it just remembers the executable bit for convenience. As to why — it's a version control system, designed to track primarily source code. Which makes that feature downright useless (not to mention 'hidden' attribute is quite useless on its own, too).

这篇关于在Windows上的Git和文件属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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