iOS 配置.gitignore文件詳細(xì)介紹
iOS 配置.gitignore文件詳細(xì)介紹
為什么要配置.gitigore
在我們使用git的過程當(dāng)中,不是任何文件都需要commit到本地或者遠(yuǎn)程倉庫的,比如一些三方庫文件。
那么作為一個(gè)git新手,很多人不知道如何配置.gitignore文件,本文只是提供一個(gè)便捷的例子。你可以直接使用本文提供的代碼編輯到你的.gitigore文件中。
簡(jiǎn)便配置
直接復(fù)制下面的內(nèi)容到你的.gitignore文件即可。注意,這個(gè)配置是給iOS開發(fā)者使用的。
# 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 輸入你需要配置的語言,會(huì)幫助你自動(dòng)生成一份配置。比如,輸入Objective-C和Swift會(huì)幫助你生成下面的配置。
# 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
這個(gè)配置自動(dòng)生成了很多注釋和一些不太必要的配置,所以直接使用上面提供的簡(jiǎn)便配置就好。
感謝閱讀,希望能幫助到大家,謝謝大家對(duì)本站的支持!
相關(guān)文章
iOS利用UIScrollView實(shí)現(xiàn)圖片的縮放實(shí)例代碼
本篇文章主要介紹了iOS利用UIScrollView實(shí)現(xiàn)圖片的縮放實(shí)例代碼,具有一定的參考價(jià)值,有興趣的可以了解一下2017-07-07
iOS APP實(shí)現(xiàn)微信H5支付示例總結(jié)
這篇文章主要介紹了iOS APP實(shí)現(xiàn)微信H5支付示例總結(jié),文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2020-02-02
iOS統(tǒng)計(jì)代碼總行數(shù)的命令(便捷且簡(jiǎn)單)
在工作中有時(shí)候會(huì)需要統(tǒng)計(jì)我們工程的總代碼行數(shù),下面小編給大家分享一個(gè)超便捷超簡(jiǎn)單的方法,通過一行命令統(tǒng)計(jì)ios代碼總行數(shù),需要的朋友參考下吧2017-11-11
IOS 時(shí)間和時(shí)間戳之間轉(zhuǎn)化示例
我們經(jīng)常從服務(wù)器后臺(tái)拿到時(shí)間戳的時(shí)間,以下代碼可以實(shí)現(xiàn)將時(shí)間戳轉(zhuǎn)為可讀的時(shí)間格式,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下。2017-01-01
iOS開發(fā)中實(shí)現(xiàn)郵件和短信發(fā)送的簡(jiǎn)單示例
這篇文章主要介紹了iOS開發(fā)中實(shí)現(xiàn)郵件和短信發(fā)送的簡(jiǎn)單示例,編程語言依然是傳統(tǒng)的Objective-C,需要的朋友可以參考下2015-09-09
iOS開發(fā)學(xué)習(xí) ViewController使用示例詳解
這篇文章主要為大家介紹了iOS開發(fā)學(xué)習(xí) ViewController使用示例詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪2022-10-10

