1.Remove existing files from the repository:
find . -name .DS_Store -print0 | xargs -0 git rm -f --ignore-unmatch
2.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). You can do this easily with this command in the top directory
echo .DS_Store >> .gitignore
3.Then
git add .gitignore
git commit -m '.DS_Store banished!'
博客介绍了在Mac系统下,针对git仓库的操作。包括从仓库中移除现有文件,将某行内容添加到仓库顶级目录的.gitignore文件(若文件不存在则创建),还提醒直接复制命令段以免出错。
3973

被折叠的 条评论
为什么被折叠?



