Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

For an Xcode project, is it good to add .xcodeproj files to the source control as well?

I am using Xcode 4.3.2 and realized that the project files are not added to the git repo, so I added them and committed: (there are 6 files)

# On branch master
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#   new file:   Proj01.xcodeproj/project.xcworkspace/contents.xcworkspacedata
#   new file:   Proj01.xcodeproj/project.xcworkspace/xcuserdata/jeremy.xcuserdatad/UserInterfaceState.xcuserstate
#   new file:   Proj01.xcodeproj/project.xcworkspace/xcuserdata/jeremy.xcuserdatad/WorkspaceSettings.xcsettings
#   new file:   Proj01.xcodeproj/xcuserdata/jeremy.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist
#   new file:   Proj01.xcodeproj/xcuserdata/jeremy.xcuserdatad/xcschemes/FlipCard.xcscheme
#   new file:   Proj01.xcodeproj/xcuserdata/jeremy.xcuserdatad/xcschemes/xcschememanagement.plist

but is it actually a good practice to do so? (one time Xcode crashed and the folder .xcodeproj was gone).

like image 888
Jeremy L Avatar asked May 15 '12 14:05

Jeremy L


People also ask

Should .xcodeproj be in Git?

xcodeproj file, yes, you should include it in your repository.

How does Xcode Source Control work?

Overview. Source control is the practice of tracking and managing changes to your code. Manage your Xcode project with source control to keep a rich history of the changes you make, and collaborate on code faster and more effectively. Xcode simplifies source control management with its built-in support for Git.

How do I add remote origin to Xcode?

Go to Source Control in Xcode and select Projectname -- master, then Configure... In the Address field, paste the Git clone URL for your repo copied in the previous step. Select Add Remote, then select Done to finish creating the origin remote for your local Git repo.

What is Xcodeproj file?

An Xcode project is a repository for all the files, resources, and information required to build one or more software products. A project contains all the elements used to build your products and maintains the relationships between those elements. It contains one or more targets, which specify how to build products.


2 Answers

As said your .xcodeproj is very important and should be included in your commit

I just want to add this link about using xcode with git which helped me a lot : http://shanesbrain.net/2008/7/9/using-xcode-with-git

like image 163
moujib Avatar answered Oct 05 '22 22:10

moujib


It's important to add the project.pbxproj file, but nothing else in the .xcodeproj bundle needs to be under version control.

like image 41
mipadi Avatar answered Oct 05 '22 22:10

mipadi