0

.DS_Storeを.gitignoreファイルに追加する人について読んだことがありますが、Git 1.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
4

1 に答える 1

2

gitのソースコード全体で再帰的なgrepを実行しましたが、git-guiディレクトリの.gitignoreを除いて、「。DS_Store」への参照は表示されませんでした。

これは、gitがそのファイルを自動的に無視しないことを意味します(MacOSビルドのgitまたはそのような奇妙なものに特別にパッチが適用されていない限り)。

おそらくそれがあなたのためにそれを無視している理由はあなたがあなたのグローバルな無視にそれを持っているということかもしれません。

于 2012-06-12T03:00:44.183 に答える