iOS日常学习 - 如何配置.gitignore文件
2016-11-21 15:29
405 查看
文章为转载学习,原文地址
那么作为一个git新手,很多人不知道如何配置.gitignore文件,本文只是提供一个便捷的例子。你可以直接使用本文提供的代码编辑到你的.gitigore文件中。
这个配置自动生成了很多注释和一些不太必要的配置,所以直接使用上面提供的简便配置就好。
为什么要配置.gitigore
在我们使用git的过程当中,不是任何文件都需要commit到本地或者远程仓库的,比如一些三方库文件。那么作为一个git新手,很多人不知道如何配置.gitignore文件,本文只是提供一个便捷的例子。你可以直接使用本文提供的代码编辑到你的.gitigore文件中。
简便配置
直接复制下面的内容到你的.gitignore文件即可。注意,这个配置是给iOS开发者使用的。# Xcode .DS_Store */build/* *.pbxuser !default.pbxuser *.mode1v3 !default.mode1v3 *.mode2v3 !default.mode2v3 *.perspectivev3 !default.perspectivev3 xcuserdata profile *.moved-aside DerivedData .idea/ *.hmap *.xccheckout *.xcworkspace !default.xcworkspace #CocoaPods Pods !Podfile !Podfile.lock
到gitignore.io去选择自定义配置
在 gitignore.io 输入你需要配置的语言,会帮助你自动生成一份配置。比如,输入Objective-C和Swift会帮助你生成下面的配置。# Created by https://www.gitignore.io/api/objective-c,swift ### 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 *.moved-aside *.xcuserstate ## 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: # https://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 # 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://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md fastlane/report.xml fastlane/screenshots ### Objective-C Patch ### *.xcscmblueprint ### Swift ### # 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 *.moved-aside *.xcuserstate ## Obj-C/Swift specific *.hmap *.ipa ## Playgrounds timeline.xctimeline playground.xcworkspace # Swift Package Manager # # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. # Packages/ .build/ # 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/ # 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://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md fastlane/report.xml fastlane/Preview.html fastlane/screenshots fastlane/test_output
这个配置自动生成了很多注释和一些不太必要的配置,所以直接使用上面提供的简便配置就好。
相关文章推荐
- iOS日常学习 - 如何配置.gitignore文件
- iOS学习之如何正确配置——PCH文件
- ios 项目 .gitignore 文件配置
- [置顶] 【iOS开发】配置忽略文件.gitignore 文件
- git的 .gitignore 如何配置(git如何忽略、追踪文件)
- iOS 配置.gitignore文件详细介绍
- 日常开发常用 .gitignore 文件配置
- 欢迎使日常开发常用 .gitignore 文件配置用CSDN-markdown编辑器
- git学习笔记-如何移除或忽略(ignore)已经提交给git管理的文件
- 【iOS开发】配置忽略文件.gitignore 文件
- 浅谈如何在Eclipse下的Android工程配置Git的.gitignore文件
- 猫猫学iOS 之第一次打开Xcode_git配置,git简单学习
- Git的.gitignore文件配置
- Git忽略文件及Unity下的ignore配置
- android studio 版本控制 .gitignore 文件配置 &&移除已上传到git的不需版本控制的文件
- flume学习(二):如何找到cm安装的flume的配置文件
- iOS开发如何配置pch文件
- .gitignore 配置文件详情
- 如何解析本地文件(iOS学习)
- Git忽略配置文件gitignore