仅使用 XCode 将文件添加到 XCode 项目而不是 git?

Add file to XCode project but NOT git using XCode only?

似乎在 git 版本控制下为项目创建 XCode 文件时,它总是会为新文件执行 git add

如果您随后提交,那么新文件将永远存在于您的存储库的历史记录中。

我想将此文件添加到 XCode 项目,但不希望 git 跟踪它。那我现在做什么:

我很乐意找到一种方法让 XCode 有选择地跳过新文件的 git add,这样我就可以跳过 git rm --cached。还将它添加到 .gitignore 会锦上添花。有人知道方法吗?

I want to add this file to the XCode project, but not have it be tracked by git.

为此,您必须在 Xcode -> 首选项 -> 源代码管理

下取消选中 Add and remove files automatically

I'd be happy to settle for a way to get XCode to optionally skip the git add

恐怕无法让它随意添加和删除文件。它要么对所有文件都是肯定的,要么对所有文件都不是。