Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should I git ignore xcodeproject/project.pbxproj file?

Tags:

git

xcode

macos

ios

in a XCode project, I offen got xcodeproject/project.pbxproj file changed, but useless info for me, it for compile.

Should I git ignore this file and xcodeproject/projectxworkspace/username.xcuserdata/UserInterfaceState.xcuserstate file?

like image 448
qichunren Avatar asked Nov 06 '11 10:11

qichunren


People also ask

What is the project Pbxproj file?

The project. pbxproj file contains metadata like settings, file references, configuration, and targeted platforms which Xcode uses to build your project. Whenever you add, move, delete or rename a file / folder in Xcode (among other things), it will result in project.

Where do I put Gitignore Xcode?

For a . gitignore file, you should place it in the root folder of the repository.


1 Answers

Update in the light of Swift Package Manager: If you're building a project as a Swift package - you should definitely ignore this file as it can be generated using file system as source of truth. You can do that by using the following command:

$ cd ~/Projects/MyProjectFolder/ $ swift package generate-xcodeproj 

For non-SwiftPM answer - see below.

This file holds the list of all the files in the project, settings of targets and which files belong to which targets. It's probably the meatiest file in project bundle. You should not ignore this file. There are few points for this:

  1. You may not want to work on this project alone or;
  2. You're planning on working on project from different machines;
  3. You'll want to share your code base with others;
like image 54
Eimantas Avatar answered Oct 17 '22 02:10

Eimantas