如何忽略Git中的模式更改
Git将跟踪文件和目录的更改,包括通过chmod完成的权限更改。在大多数开发环境中,我倾向于拥有与现场站点上不同的权限集,因此我通常对跟踪权限更改不感兴趣。为了防止git查看文件权限之间的差异,您需要将core.filemode配置选项设置为false。
gitconfigcore.filemodefalse
这是git-config(1)手册页上的条目。
core.fileMode If false, the executable bit differences between the index and the working tree are ignored; useful on broken filesystems like FAT. See git-update-index(1). The default is true, except git-clone(1) or git-init(1) will probe and setcore.fileModefalse if appropriate when the repository is created.
此信息最初来自Stackoverflow上的这篇文章。我一直都忘记如何做到这一点,因此,为了撰写记忆,我正在写这篇文章。