【问题标题】:What to add to a .gitignore for an Xcode project为 Xcode 项目添加什么到 .gitignore
【发布时间】:2021-11-30 20:27:47
【问题描述】:

我刚刚开始了一个协作 Xcode 项目,并且遇到了我的协作者在他们的项目中无意更改的问题。对于这样的项目,我应该在我的 .gitignore 中添加什么?我已经看到了 .xcuserdata 的问题,只是举个例子。

【问题讨论】:

    标签: xcode git gitignore


    【解决方案1】:

    我建议也将.DS_Store 添加到您的 .gitignore 文件中。

    【讨论】:

      【解决方案2】:

      互联网上有可用的模板。一些最著名的是

      【讨论】:

        【解决方案3】:

        我已经包含了 GitHub 使用的 .gitignore 文件,Objective-C。 .gitignore 文件的父 .gitignore 存储库对于其他语言也非常有用。

        # Xcode
        #
        # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
        
        ## User settings
        xcuserdata/
        
        ## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9)
        *.xcscmblueprint
        *.xccheckout
        
        ## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4)
        build/
        DerivedData/
        *.moved-aside
        *.pbxuser
        !default.pbxuser
        *.mode1v3
        !default.mode1v3
        *.mode2v3
        !default.mode2v3
        *.perspectivev3
        !default.perspectivev3
        
        ## Obj-C/Swift specific
        *.hmap
        
        ## App packaging
        *.ipa
        *.dSYM.zip
        *.dSYM
        
        # CocoaPods
        #
        # We recommend against adding the Pods directory to your .gitignore. However
        # you should judge for yourself, the pros and cons are mentioned at:
        # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
        #
        # Pods/
        #
        # Add this line if you want to avoid checking in source code from the Xcode workspace
        # *.xcworkspace
        
        # Carthage
        #
        # Add this line if you want to avoid checking in source code from Carthage dependencies.
        # Carthage/Checkouts
        
        Carthage/Build/
        
        # fastlane
        #
        # It is recommended to not store the screenshots in the git repo.
        # Instead, use fastlane to re-generate the screenshots whenever they are needed.
        # For more information about the recommended setup visit:
        # https://docs.fastlane.tools/best-practices/source-control/#source-control
        
        fastlane/report.xml
        fastlane/Preview.html
        fastlane/screenshots/**/*.png
        fastlane/test_output
        
        # Code Injection
        #
        # After new code Injection tools there's a generated folder /iOSInjectionProject
        # https://github.com/johnno1962/injectionforxcode
        
        iOSInjectionProject/
        

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2011-03-05
          • 1970-01-01
          • 2011-11-16
          • 2016-06-04
          • 2011-03-14
          相关资源
          最近更新 更多