我读到过有人将.DS_Store添加到他们的.gitignore文件中,但我使用Git1.7.6做了一个快速测试,我不确定这是否有必要。你认为如何?
johndoe@John-Does-MacBook-Pro:~$ mkdir test
johndoe@John-Does-MacBook-Pro:~$ cd test/
johndoe@John-Does-MacBook-Pro:~/test$ git init
Initialized empty Git repository in /Users/johndoe/test/.git/
johndoe@John-Does-MacBook-Pro:~/test$ touch foo.txt
johndoe@John-Does-MacBook-Pro:~/test$ touch .DS_Store
johndoe@John-Does-MacBook-Pro:~/test$ touch bar.txt
johndoe@John-Does-MacBook-Pro:~/test$ touch .DS_Store2
johndoe@John-Does-MacBook-Pro:~/test$ git status
# On branch master
#
# Initial commit
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# .DS_Store2
# bar.txt
# foo.txt
nothing added to commit but untracked files present (use "git add" to track)
johndoe@John-Does-MacBook-Pro:~/test$ git config -l
user.name=John Doe
user.email=johndoe@example.com
color.ui=true
core.editor=mate -w
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
core.ignorecase=true发布于 2012-06-12 11:00:44
我对git的整个源代码进行了递归grep,除了在git-gui目录的.gitignore中,没有看到任何对".DS_Store“的引用。
这意味着git不会自动忽略这个文件(除非它在git的MacOS版本中打了特别的补丁,或者类似的奇怪的东西)。
可能它忽略它的原因可能是你的全局忽略了它。
https://stackoverflow.com/questions/10989060
复制相似问题