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

为什么要配置.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文件的更多相关文章

  1. 第四十四篇、iOS开发中git添加.gitignore文件

    .gitignore文件可以直接使用https://github.com/github/gitignore 1.在项目中设置忽略文件(1)将从github上荡下来的对应的.gitignore文件(Sw ...

  2. iOS日常学习 - App之间常用的五种通信方式及适用场景总结

    本文为转载学习,原文地址 iOS系统是相对封闭的系统,App各自在各自的沙盒(sandbox)中运行,每个App都只能读取iPhone上iOS系统为该应用程序程序创建的文件夹AppData下的内容,不 ...

  3. iOS日常学习 - 每个Xcode开发者应该知道的七个使用技巧

    本文为转载学习使用原文链接 工欲善其事,必先利其器.对一个iOS开发者来说,这就意味着对Xcode的熟练掌握程度.Xcode是一个学习起来有点难度的软件,下面的这些技巧或许可以显著的提高你的编程效率. ...

  4. 【转】 iOS日常学习 - iOS10上关于NSPhotoLibraryUsageDescription等问题

    原文网址:http://blog.csdn.net/wang631106979/article/details/52578001 最近升级了Xcode8.0,真是很多坑啊,填完一个来另外一个,今天又遇 ...

  5. iOS日常学习 - iOS10上关于NSPhotoLibraryUsageDescription等问题

    最近升级了Xcode8.0,真是很多坑啊,填完一个来另外一个,今天又遇到了一个,用Xcode8.0上传项目时被驳回说是info.plist里面没有设置NSPhotoLibraryUsageDescri ...

  6. iOS日常学习 - 让你的 Xcode8 继续使用插件

    本文转载,原文链接 随着 iOS10 的正式版即将发布,Xcode8 GM 也在发布会后放出,本文不会涉及到 Xcode8 有哪些更新,而是记录了如何让 Xcode8 继续支持 Plugin. 相信各 ...

  7. ios网络学习------10 原生API文件上传

    使用原生态的api上传文件的实现: #import "MainViewController.h" @interface MainViewController () @propert ...

  8. ios网络学习------11 原生API文件上传之断点续传思路

    watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvaHVhbmcyMDA5MzAzNTEz/font/5a6L5L2T/fontsize/400/fill/I0 ...

  9. $git学习总结系列(4)——gitignore文件

    有时候工作区中会有我们创建的一些密码配置文件,或者自动生成的一些临时文件,比如python代码编译产生的.pyc文件和java代码编译产生的.class文件等,我们在提交代码的时候没有必要把这些文件也 ...

随机推荐

  1. CentOS7.2编译配置LNMP环境(MySQL5.7.20,PHP7.0.24)

    一,     查看系统版本及内核版本 二,     编译安装nginx 1,          新建nginx用户 useradd -s /sbin/nologin -M nginx 2,       ...

  2. ora-04021 无法锁表的解决办法

    案例场景: 备库上有一张分区表,在做数据导入出了点问题,需要truncate掉重新导入,在执行truncate table时发生了04021错误. 错误分析: ora-04021的解释是等待锁定对象时 ...

  3. 隐藏Apache、nginx和PHP的版本号的配置方法

    最近提示说有漏洞,暴露apache.nginx和php的版本号.网上搜了下,整理的方法如下: 首先说apache 在http.conf文件里添加下面两行,默认是没有的 ServerSignature ...

  4. 6.2 - BBS + BLOG系统

    一.简介 博客系统开发: 1.注册,登录,首页 2.个人站点,分组:(分类,标签,归档)3.文章详细页4.点赞,踩灭5.评论楼,评论树6.后台管理,发布文章,文件上传7.BeautifulSoup8. ...

  5. Win10新建文件不自动刷新

    Win10 桌面创建文件/文件夹需要F5刷新才出来,资源管理器中创建也是一样的问题. 网上搜索的结果都以修改注册表,禁用音频面板检测,上述方案可能能解决部分情况. 实际上是桌面图标缓存出问题,以下是一 ...

  6. Spring第一弹—-全面阐述Spring及轻重量级容器的划分

    Spring是什么? Spring是一个开源的控制反转(Inversion of Control ,IoC)和面向切面(AOP)的容器框架,它的主要目得是简化企业开发. IOC 控制反转 :   1 ...

  7. Oracle优化-SQL_TRACE

    思维导图 Oracle优化10-SQL_TRACE解读 Oracle优化11-10046事件 概述 当我们想了解一条SQL或者是PL/SQL包的运行情况时,特别是当他们的性能非常差时,比如有的时候看起 ...

  8. 页面优化——减少HTTP请求数

    1.关于减少http请求数 关于减少http请求数,是前端开发性能优化的一个非常重要方面,所以在基本所有的优化原则里,都有这一条原则:减少http请求数. 先不考虑其他的,我们先考虑为什么减少http ...

  9. git 更新某个文件

    1.拉取某个仓库的某个文件 git fetch git checkout origin/master test.php

  10. 前端神器ws激活步骤

    第一步:下载破解文件 也可以直接去我的github仓库中下载 第二步骤:操作bin目录的文件bin目录window下和mac下大致相同,故而不在单独说window a.将补丁复制到webstorm安装 ...