git - git 是否跟踪资源 fork ?

标签 git macos version-control metadata

每次替换受版本控制的 Photoshop .psd 文件时,我都会问自己这个问题。

您可以使用 ls -l 看到 PS 已经在资源分支中创建了一个缩略图图标。

最佳答案

Git 不会跟踪元数据,因为这些资源不是文件内容的一部分(所以你的答案是“否”)。

在他的“跨平台版本控制”条目中,Jakub Narębski评论:

The issue of extra metadata that is not SCM-sane, and which different filesystems can or cannot store.
Examples include full Unix permissions, Unix ownership (and groups file belongs to), other permission-related metadata such as ACL, extra resources tied to file such as EA (extended attributes) for some Linux filesystems or (in)famous resource form in MacOS (resource fork on MacOS vs. xattrs on Linux: issue 5 in Eric Sink article).

This is not an issue for SCM: source code management system to solve.
Preserving extra metadata indiscrimitedly can cause problems, like e.g. full permissions and ownership.
Therefore SCM preserve only limited SCM-sane subset of metadata.
If you need to preserve extra metadata, you can use (in good SCMs) hooks for that, like e.g. etckeeper uses metastore (in Git).


Thomas Tempelmann the comments 中的注释:

Actually, since macOS 10.12, textClippings store the info also in the data fork, in plist format, with the same keys and values of the resource fork's contents.

The only thing that won't work is QuickLook if the rsrc is missing, but opening these files will show the content.
Therefore, storing .textClipping files in Git is not hopeless.

关于git - git 是否跟踪资源 fork ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1130059/

相关文章:

Git Bash - 在完整的 C :\hard drive 上意外地从 Bash 调用了 git init

git - 如何在 git 中使用 "publish"私有(private) Typescript npm 包?

git - 如何使当前的功能分支与远程分支保持更新?

regex - 在 OSX 上使用 sed 设置 PermitRootLogin

xcode - 如何在我的 Xcode 项目中查看整个 SCM 历史记录?

git - 这个 git-LFS 损坏的文件错误是什么意思以及如何修复它?

objective-c - 将 NSTextField 转换为 Label

c# - 单声道剪贴板修复

git - 列出其他人(即不是我)所做的提交?

svn - SVN 变更日志中的作者姓名对于跟踪作者身份可靠吗?