본문 바로가기

iOS

[iOS] how to create iOS/swift .gitignore in MacOS terminal(console)

# console(terminal)에서 iOS/swift .gitignore 생성하기





console(terminal)에서 작업.


console(terminal)로 git 프로젝트 이동.


https://gitignore.io 에서 ignore 기본값을 받아오도록 git config 설정 ( .gitignore 파일은 아직 생성되지 않음 )


 $ git config --global alias.ignore '!gi() { curl -L -s https://www.gitignore.io/api/$@ ;}; gi' 




.gitignore 에 swift 및 macos 관련 설정 추가 및 적용 ( .gitignore 파일 생성 )


 $ git ignore swift,macos > .gitignore 




추가한 .gitignore를 remote 에 add / commit / push


$ git add .gitignore

 $ git commit -m "Add .gitignore file"

 $ git push origin master




.gitignore에 설정된 내용



# Created by https://www.gitignore.io/api/swift,macos

# Edit at https://www.gitignore.io/?templates=swift,macos


### macOS ###

# General

.DS_Store

.AppleDouble

.LSOverride


# Icon must end with two \r

Icon


# Thumbnails

._*


# Files that might appear in the root of a volume

.DocumentRevisions-V100

.fseventsd

.Spotlight-V100

.TemporaryItems

.Trashes

.VolumeIcon.icns

.com.apple.timemachine.donotpresent


# Directories potentially created on remote AFP share

.AppleDB

.AppleDesktop

Network Trash Folder

Temporary Items

.apdisk


### 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

*.xccheckout

*.xcscmblueprint


## Obj-C/Swift specific

*.hmap

*.ipa

*.dSYM.zip

*.dSYM


## 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/

# Package.pins

# Package.resolved

.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/

# 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/


# End of https://www.gitignore.io/api/swift,macos

 





끝.