Xcode, git, and gitignore

What is the Apple way of telling Xcode to ignore the project.pbxproj file?

i am working with some one else and we have different credentials. I can see the differences by diffing the project.pbxproj file.

Pushing this file to github will cause problems, obviously. In my unix days I would create a .gitignore file. My partner is a Mac dyed in the wool type, who would rather not use the command line. Is there a option for doing this in Xcode?

Answered by szymczyk in 636097022
In Xcode's Source Control preferences, click the Git button. There is an Ignored Files list where you can add files to ignore.

One thing to keep in mind is if git is tracking a file before you add files to ignore, git will keep tracking the file. You will have to temporarily move the file out of the .git folder (This basically involves moving the file out of the project folder), commit to git, then move the file back.
Wierdly enough:

Code Block
user$ git status
On branch master
Your branch is up to date with 'origin/master'.
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: B52FloorManagement.xcodeproj/project.pbxproj
modified: B52FloorManagement/Info.plist


This indicates that git is not going to commit the very file I want to stop it committing. But when I use Source Control -> Commit in Xcode it wants to commit those files.

Weird....

Accepted Answer
In Xcode's Source Control preferences, click the Git button. There is an Ignored Files list where you can add files to ignore.

One thing to keep in mind is if git is tracking a file before you add files to ignore, git will keep tracking the file. You will have to temporarily move the file out of the .git folder (This basically involves moving the file out of the project folder), commit to git, then move the file back.
Xcode, git, and gitignore
 
 
Q