当我在我的目录上执行“git status”时,它显示了一堆似乎是重复的未跟踪文件。唯一的区别是它们都有一个前缀._
。例如:我需要添加的未跟踪文件之一是...app/assets/stylesheets/categories.css
,另一个文件将显示为 app/assets/stylesheets/。 _类别.css
。
有人知道这是怎么回事吗? GitHub 上好像没有什么好的文档。
最佳答案
作为mentioned here :
if for file foo you have another ._foo, and you're on a Mac, the dot-underscore file is where the file resource fork / metadata is kept.
(在“DS_Store, dot underscore (._
), resource forks and annoyed Windows users”中有更详细的描述)
The
.DS_Store
is similar to thethumbs.db
file Windows XP makes and is used to store “custom attributes of a folder such as the position of icons or the choice of a background image.”The dot-underscore (
._
) files are pesky little buggers. It seems that when you use the Finder to transfer files to a non-Mac system–a Windows Server in this case–it splits the file into two parts – the data and the resource forks. When you copy the file back to the Mac, the Finder merges the two bits again. Windows can’t use the resource fork, so it’s not needed and you can delete it, but it’s a lot of hassle having to clean up after others!
另请参阅“Is there any way to prevent a Mac from creating dot underscore files?”
关于git - 我的 git 存储库中所有这些 stash 的 ('._' 前缀)文件是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10323580/