美文网首页
增加忽略文件配置

增加忽略文件配置

作者: RichieQ | 来源:发表于2019-10-17 09:15 被阅读0次

1、获取对应语言的忽略文件配置github
2、在.git同级目录下

git rm --cached *.xcuserstate
git rm --cached *.xcuserdata
这两行代码(或者可以有更多,自己修改后缀名即可,这里列出了常见的两种隐藏文件)表示不再追踪以这些后缀结尾的文件,注意这里的文件在执行代码前其实已经被追踪(Tracked),执行完后,将不再被追踪。

touch .gitignore
open .gitignore
复制对应语言的忽略文件配置(iOS是用Objective-C.gitignore,内容如下)
# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore

## User settings
xcuserdata/

## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9)
*.xcscmblueprint
*.xccheckout

## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4)
build/
DerivedData/
*.moved-aside
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3

## Obj-C/Swift specific
*.hmap

## App packaging
*.ipa
*.dSYM.zip
*.dSYM

# 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/
#
# Add this line if you want to avoid checking in source code from the Xcode workspace
# *.xcworkspace

# 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://docs.fastlane.tools/best-practices/source-control/#source-control

fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots/**/*.png
fastlane/test_output

# Code Injection
#
# After new code Injection tools there's a generated folder /iOSInjectionProject
# https://github.com/johnno1962/injectionforxcode

iOSInjectionProject/


git add .gitignore
git commit -m '添加忽略文件'
git push

重启xcode即会生效

相关文章

网友评论

      本文标题:增加忽略文件配置

      本文链接:https://www.haomeiwen.com/subject/udpvyctx.html