【问题标题】:How to add podfile.lock and .DS_store to .gitignore如何将 podfile.lock 和 .DS_store 添加到 .gitignore
【发布时间】:2021-01-27 10:33:28
【问题描述】:

我在 .gitignore 中添加了这样的内容:

Pods/
MyStarhub.xcworkspace/
*/xcuserdata/
DerivedData/*
Podfile.lock
*.DS_Store
*.icloud

但 git 出于某种原因一直在跟踪 .Ds_Store Podfile.lock

【问题讨论】:

标签: swift xcode git gitignore


【解决方案1】:

可能是因为 git 仍在跟踪您之前推送的文件。试试:

git rm --cached .DS_Store
git rm --cached Podfile.lock

或者干脆删除文件,提交并推送

【讨论】:

  • 感谢您的回答。但是当我尝试时,这两个文件出现在“暂存文件”部分,带有红色减号图标。所以我仍然必须提交它们对吗?
  • 是的,减号表示您正在从跟踪中删除它们。
猜你喜欢
  • 1970-01-01
  • 2020-03-01
  • 2015-06-21
  • 1970-01-01
  • 2012-01-04
  • 1970-01-01
  • 1970-01-01
  • 2014-01-29
  • 2015-11-08
相关资源
最近更新 更多