可能重复:
git - removing a file from source control (but not from the source)
我有一个.DS_Store文件位于项目/ app / assets / javascripts中。
如何从此文件中删除git tracking?
答案 0 :(得分:4)
rm .DS_Store
git add -A
git commit -m "getting rid of artifact."
echo .DS_Store >> .gitignore
git add -A
git commit -m "ignoring artifact."