Git 显示更改文件权限后修改的所有文件

  • 本文关键字:文件 修改 权限 显示 Git git
  • 更新时间 :
  • 英文 :


我将 Ubuntu OS 上非裸 git 存储库的文件权限更改为 777。之后,存储库中的所有文件都显示为已修改。我不想再次添加所有文件并提交。我想提交我编辑的文件。有什么办法可以解决这个问题吗?

git config core.fileMode false

这告诉 git 忽略执行位更改。

如果要忽略文件权限更改,可以添加:

git config core.fileMode false

到你的 ~/.gitconfig。请参阅 http://git-scm.com/docs/git-config

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 set core.fileMode false if appropriate when the repository is created.

最新更新