一、關(guān)于.gitignore,這里不再贅述,GitHub上有所有的例子:https://github.com/github/gitignore
二、關(guān)于忽略文件有時候都無法忽略的某些文件:.DS_Store和UserInterfaceState.xcuserstate,是不是就想把它們?nèi)繗⒌?!多謝大神支持,現(xiàn)提供兩條正確的刪除命令(注意:刪除這兩文件不會影響項(xiàng)目)。
刪除項(xiàng)目中所有的.DS_Store文件
進(jìn)入項(xiàng)目位置后,運(yùn)行命令:
find . -name .DS_Store -print0 | xargs -0 git rm -f --ignore-unmatch
刪除UserInterfaceState.xcuserstate
進(jìn)入項(xiàng)目位置后,運(yùn)行命令:
git rm --cached 項(xiàng)目名稱.xcworkspace/xcuserdata/我的終端用戶名稱.xcuserdatad/UserInterfaceState.xcuserstate
然后提交修改即可。