What goes into your .gitignore if you're using CocoaPods?

前端 未结 19 1031
南旧
南旧 2020-11-29 14:47

I\'ve been doing iOS development for a couple of months now and just learned of the promising CocoaPods library for dependency management.

I tried it out on a person

19条回答
  •  [愿得一人]
    2020-11-29 15:11

    .gitignore file

    No answer actually offers a .gitignore, so here are two flavors.


    Checking in the Pods directory (Benefits)

    Xcode/iOS friendly git ignore, skipping Mac OS system files, Xcode, builds, other repositories and backups.

    .gitignore:

    # Mac OS X Finder
    .DS_Store
    
    # Private Keys
    *.pem
    
    # Xcode legacy
    *.mode1
    *.mode1v3
    *.mode2v3
    *.perspective
    *.perspectivev3
    *.pbxuser
    
    # Xcode
    xcuserdata/
    project.xcworkspace/
    DerivedData/
    
    # build products
    build/
    *.[oa]
    
    # repositories
    .hg
    .svn
    CVS
    
    # automatic backup files
    *~.nib
    *.swp
    *~
    *(Autosaved).rtfd/
    Backup[ ]of[ ]*.pages/
    Backup[ ]of[ ]*.key/
    Backup[ ]of[ ]*.numbers/
    

    Ignoring the Pods directory (Benefits)

    .gitignore: (append to previous list)

    # Cocoapods
    Pods/
    

    Whether or not you check in the Pods directory, the Podfile and Podfile.lock should always be kept under version control.

    If Pods are not checked-in, your Podfile should probably request explicit version numbers for each Cocoapod. Cocoapods.org discussion here.

提交回复
热议问题