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:
- (XCode) Create the file in XCode
- (Terminal) Create .gitignore for the project repo
- (Terminal) add and commit .gitignore with the file's name in it
- (Terminal)
git rm --cachedon the file which XCode added to git - (XCode) Verify that the file cannot be selected for a commit in the XCode commit window
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?
