Remove existing files from the repository:
(从存储库中删除现有文件:)
find . -name .DS_Store -print0 | xargs -0 git rm -f --ignore-unmatch
Add the line
(添加行)
.DS_Store
to the file .gitignore
, which can be found at the top level of your repository (or created if it isn't there already).
(到.gitignore
文件中,该文件可以在您的存储库的顶层找到(或如果尚未存在则创建)。)
You can do this easily with this command in the top directory (您可以在顶层目录中使用此命令轻松完成此操作)
echo .DS_Store >> .gitignore
Then
(然后)
git add .gitignore
git commit -m '.DS_Store banished!'
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…