文章为转载学习,原文地址

为什么要配置.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

这个配置自动生成了很多注释和一些不太必要的配置,所以直接使用上面提供的简便配置就好。

最新文章

  1. Linux下命令行安装weblogic10.3.6
  2. js对文本框特殊字符串过滤
  3. Struts2+jQuery+Json零配置实现ajax
  4. Apache Thrift - 可伸缩的跨语言服务开发框架
  5. 使用Aspose.Cells组件生成Excel文件
  6. HTTP Status 500 - Servlet.init() for servlet htmlWebConfig threw exception
  7. HDU4758 Walk Through Squares AC自动机&&dp
  8. RWD
  9. Zookeeper集群安装详解
  10. UVA 11584 Paritioning by Palindromes(动态规划 回文)
  11. jenkins 安装 SVN Publisher 后向 svn 提交代码报错: E170001: Authentication required for...
  12. KoaHub平台基于Node.js开发的Koa的get/set session插件代码详情
  13. golang接口三个特性
  14. python3 Flask -day1
  15. GNOME图形界面的基本操作
  16. Echarts 饼状图自定义颜色
  17. knowledge_map 修改笔记
  18. BETA-4
  19. POJ3233:Matrix Power Series(矩阵快速幂+二分)
  20. Unity 软件使用事项

热门文章

  1. Python巨蟒全栈开发目录
  2. Codeforces Round #425 (Div. 2))——A题&&B题&&D题
  3. 对于应用需要记录某个方法耗时的场景,必须使用clock_gettime传入CLOCK_MONOTONIC参数,该参数获得的是自系统开机起单调递增的纳秒级别精度时钟,相比gettimeofday精度提高不少,并且不受NTP等外部服务影响,能准确更准确来统计耗时(java中对应的是System.nanoTime),也就是说所有使用gettimeofday来统计耗时(java中是System.curre
  4. 【opencv】cv::Mat_ 对单个元素赋值
  5. git 常用文件目录介绍
  6. KVm中EPT逆向映射机制分析
  7. C#建WindowForm调用R可视化
  8. html5游戏开发--"动静"结合(二)-用地图块拼成大地图 & 初探lufylegend
  9. Java 运算符及优先级
  10. 机器学习算法(优化)之一:梯度下降算法、随机梯度下降(应用于线性回归、Logistic回归等等)