stevesliva
stevesliva

Reputation: 5665

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

It seems that when you create a file with XCode for a project under git version control, it will always do a git add for the new file.

If you then commit, then the new file's in your repo's history for good.

I want to add this file to the XCode project, but not have it be tracked by git. So what I do now:

I'd be happy to settle for a way to get XCode to optionally skip the git add for the new file so that I can skip git rm --cached. Also adding it to the .gitignore would be icing. Anyone know a way?

Upvotes: 1

Views: 568

Answers (1)

Tim
Tim

Reputation: 43314

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

To achieve this, you must uncheck the Add and remove files automatically under Xcode -> Preferences -> Source Control

enter image description here

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

I'm afraid it's not possible to have it add and remove files optionally. It either yes for all files, or no for all files.

Upvotes: 2

Related Questions