iOS 配置.gitignore文件详细介绍

 更新时间:2017年04月28日 16:20:58   投稿:lqh  
这篇文章主要介绍了iOS 配置.gitignore文件详细介绍的相关资料,需要的朋友可以参考下

iOS 配置.gitignore文件详细介绍

为什么要配置.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利用UIScrollView实现图片的缩放实例代码

    iOS利用UIScrollView实现图片的缩放实例代码

    本篇文章主要介绍了iOS利用UIScrollView实现图片的缩放实例代码,具有一定的参考价值,有兴趣的可以了解一下
    2017-07-07
  • IOS 仿支付宝支付屏幕亮度变化机制

    IOS 仿支付宝支付屏幕亮度变化机制

    这篇文章主要介绍了IOS 仿支付宝支付屏幕亮度变化机制的相关资料,非常不错,具有参考借鉴价值,需要的朋友可以参考下
    2017-01-01
  • iOS横竖屏旋转内容总结

    iOS横竖屏旋转内容总结

    本篇文章给大家总结了iOS横竖屏旋转的相关内容以及实现的代码分享,有需要的朋友参考下吧。
    2018-01-01
  • iOS文本的多语言适配以及实践指南

    iOS文本的多语言适配以及实践指南

    项目开发中考虑到不同国家的用户,不同国家的语言,因而在APP里面做了多语言,所以下面这篇文章主要给大家介绍了关于iOS文本的多语言适配以及实践的相关资料,需要的朋友可以参考下
    2021-09-09
  • iOS APP实现微信H5支付示例总结

    iOS APP实现微信H5支付示例总结

    这篇文章主要介绍了iOS APP实现微信H5支付示例总结,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧
    2020-02-02
  • IOS 指纹识别详解及实例代码

    IOS 指纹识别详解及实例代码

    这篇文章主要介绍了IOS 指纹识别详解的相关资料,并附实例代码,需要的朋友可以参考下
    2016-11-11
  • iOS统计代码总行数的命令(便捷且简单)

    iOS统计代码总行数的命令(便捷且简单)

    在工作中有时候会需要统计我们工程的总代码行数,下面小编给大家分享一个超便捷超简单的方法,通过一行命令统计ios代码总行数,需要的朋友参考下吧
    2017-11-11
  • IOS 时间和时间戳之间转化示例

    IOS 时间和时间戳之间转化示例

    我们经常从服务器后台拿到时间戳的时间,以下代码可以实现将时间戳转为可读的时间格式,具有一定的参考价值,感兴趣的小伙伴们可以参考一下。
    2017-01-01
  • iOS开发中实现邮件和短信发送的简单示例

    iOS开发中实现邮件和短信发送的简单示例

    这篇文章主要介绍了iOS开发中实现邮件和短信发送的简单示例,编程语言依然是传统的Objective-C,需要的朋友可以参考下
    2015-09-09
  • iOS开发学习 ViewController使用示例详解

    iOS开发学习 ViewController使用示例详解

    这篇文章主要为大家介绍了iOS开发学习 ViewController使用示例详解,有需要的朋友可以借鉴参考下,希望能够有所帮助,祝大家多多进步,早日升职加薪
    2022-10-10

最新评论