iOS私有pod库的gitignore文件

我们在进行pod 死有库开发的时候,如果使用默认生成的gitignore 文件,每次提交和拉代码都会有大量的冲突,会严重干扰我们正常的开发,所以有必要进行设置一些忽略文件

通常pods 文件夹中的文件是要忽略的,还会有podfile.lock文件

下面贴出我们进行私有库开发的gitignore 文件中的配置

# macOS
.DS_Store

# Xcode
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata/
*.xccheckout
*.moved-aside
DerivedData
*.hmap
*.ipa

# Bundler
.bundle

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

Carthage/Build

# 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-ignore-the-pods-directory-in-source-control
# 
# Note: if you ignore the Pods directory, make sure to uncomment
# `pod install` in .travis.yml
#
Example/Pods/*
Example/Podfile.lock

注意:自己新加的是下面两行

Example/Pods/*
Example/Podfile.lock

因为我们的 Pods文件夹和Podfile.lock 都是在示例工程中
所以前面要有Example

这里要注意一个gitignore 的一个格式要求

Example/Pods/* 表示忽略 Example/Pods 文件夹下的所有文件,
并且这里测了一下 Example/Pods/ 效果是一样的,都是忽略 Example 下的 pods 文件夹

Example/Podfile.lock 表示忽略 Example下的Podfile.lock 文件

3 一个注意点:
如果我们修改过gitignore文件之后,执行了 git rm -r --cached . 命令之后,
发现我们的gitignore 设置的忽略文件有错误,不要着急,先不要commit ,
将gitignore 文件里面的设置修改成正确的之后,再执行 git rm -r --cached . 命令就行了
如 执行过 git rm -r --cached . 之后发现忽略配置有误 请添加图片描述
修改忽略配置文件
请添加图片描述
然后再执行 git rm -r --cached .
就好了
请添加图片描述

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值