美文网首页
Git忽略文件.gitignore的使用:忽略DS_Store、

Git忽略文件.gitignore的使用:忽略DS_Store、

作者: 日拱一卒wu | 来源:发表于2016-05-11 10:25 被阅读950次

    声明:本文原创,所有转载必须经过本人同意,否则默认同意支付本人稿费(千字百元)。---绪文(公众号:LearnWithSiven)

    在开发中,项目中会产生一些我们不希望提交到Git的个人信息或配置的文件,现使用.gitignore文件忽略掉。

    Step 1: 进入项目目录:cd  <ProjectName>

    Step 2: 查看状态: git  stauts

    Step 3: 创建gitignore文件:touch  .gitignore    #创建隱藏文件gitignore

    Step 4: 编辑gitignore文件: vim    .gitignore    #编辑该文件,下附内容,知道Vim基本命令

    Step 5: Git添加.gitignore文件: git add .gitignore

    Step 6: 现在可以再查看结果状态: git  stauts

    附:

    # ---> Objective-C

    # Xcode

    #

    # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore

    ## Build generated

    build/

    DerivedData

    ## Various settings

    *.pbxuser

    !default.pbxuser

    *.mode1v3

    !default.mode1v3

    *.mode2v3

    !default.mode2v3

    *.perspectivev3

    !default.perspectivev3

    xcuserdata

    ## Other

    *.xccheckout

    *.moved-aside

    *.xcuserstate

    *.xcscmblueprint

    ## Obj-C/Swift specific

    *.hmap

    *.ipa

    # CocoaPods

    #

    # We recommend against adding the Pods directory to your .gitignore. However

    # you should judge for yourself, the pros and cons are mentioned at:

    # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control

    #

    #Pods/

    # Carthage

    #

    # Add this line if you want to avoid checking in source code from Carthage dependencies.

    # Carthage/Checkouts

    Carthage/Build

    相关文章

      网友评论

          本文标题:Git忽略文件.gitignore的使用:忽略DS_Store、

          本文链接:https://www.haomeiwen.com/subject/euzyrttx.html