What should be in my gitignore for Xcode 7

16,357

Here's the one I tend to use:

.DS_Store
build
*.xcodeproj/*
!*.xcodeproj/project.pbxproj

That will ignore .DS_Store files, the build directory, and everything in .xcodeproj files except the file that actually contains the project's settings. If you have shared schemes, you can also add

!*.xcodeproj/xcshareddata

as show here.

Share:
16,357

Related videos on Youtube

Jeef
Author by

Jeef

Software Dev

Updated on September 16, 2022

Comments

  • Jeef
    Jeef over 1 year

    With Xcode 7 finally released I was wondering what an appropriate setting for .gitignore was for Xcode projects in the new version, and whether the same settings that were applicable in XCODE 6 still apply.

    NOTE This is XCODE 7 Specific. There are various answers for other version of XCODE but I am unaware if 7 adds any new files or types that should be added to the .gitignore.

  • Arkku
    Arkku over 8 years
    I wouldn't ignore *.xcodeproj, rather ignore xcuserdata.
  • mipadi
    mipadi about 8 years
    @Arkku: project.pbxproj and xcshareddata (possibly) are really the only files in the a .xcodeproj that need to be tracked.
  • Arkku
    Arkku about 8 years
    True at the moment (unless it contains workspaces?), but I would rather blacklist than whitelist here, since a) currently it's simpler that way, and b) the contents of .xcodeproj could change without notice as it is a proprietary format…