xcodeproj under version control

前端 未结 3 1327
梦毁少年i
梦毁少年i 2020-12-04 12:26

What are the best practices while including a Xcode project under version control.

相关标签:
3条回答
  • 2020-12-04 13:05

    Check in project.pbxproj, ignore the user specific files.

    Include shared components and third party libraries as project dependencies using submodules/externals/whatever your VCS supports instead of manually copying static library binaries without any history.

    You will get merge conflicts in the project.pbxproj, be prepared to deal with this and try to minimize the difficulty of resolving them.

    • Have a consistent structure for where files should be on disk and how that maps to groups in Xcode.
    • Sort the resources included in your build targets and the order of resources within your project's groups. I really need to write a script to do this for me because it is so much easier to identify the cause of a merge conflict when you don't have to diff two random sets of files. It also avoids many merge conflicts as you're less likely to have multiple developers all appending new resources to the bottom of a list.

    Check in early and often.

    0 讨论(0)
  • 2020-12-04 13:05

    In my project I have Project.xcodeproj/project.pbxproj in version control and leave out the User.mode1v3 and User.pbxuser files.

    project.pbxproj seems to hold the metadata for the project, such as where the files are located and what the build settings are.

    The user files would have things like what files are opened, where the cursor is, etc.

    You can also refer to THIS question for what files some people have chosen to ignore.

    0 讨论(0)
  • 2020-12-04 13:08

    This is what is in my Global .gitignore file which you can see as a gist on GitHub, but the Xcode list can be applied to other systems

    # Mac OS X
    *.DS_Store
    
    # Xcode
    *.pbxuser
    *.mode1v3
    *.mode2v3
    *.perspectivev3
    *.xcuserstate
    project.xcworkspace/
    xcuserdata/
    
    # Generated files
    *.o
    *.pyc
    
    #Python modules
    MANIFEST
    dist/
    build/
    
    # Backup files
    *~.nib
    \#*#
    .#*
    
    0 讨论(0)
提交回复
热议问题