iOS

[Xcode] git ignore 설정

i-moo 2020. 7. 2. 00:41
반응형

 

 

 

 

하단 사이트에서 ignore 파일에 넣을 내용을 쉽게 확인 할 수 있다.

www.toptal.com/developers/gitignore

 

gitignore.io

Create useful .gitignore files for your project

www.toptal.com

 

Swift Objective-C Xcode CocoaPods

 

.gitignore 파일 내용

더보기

 

# Created by https://www.toptal.com/developers/gitignore/api/swift,objective-c,xcode,cocoapods

# Edit at https://www.toptal.com/developers/gitignore?templates=swift,objective-c,xcode,cocoapods

 

### CocoaPods ###

## CocoaPods GitIgnore Template

 

# CocoaPods - Only use to conserve bandwidth / Save time on Pushing

#           - Also handy if you have a large number of dependant pods

#           - AS PER https://guides.cocoapods.org/using/using-cocoapods.html NEVER IGNORE THE LOCK FILE

Pods/

 

### Objective-C ###

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

 

### Objective-C Patch ###

 

### Swift ###

# Xcode

# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore

 

 

 

 

 

 

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

# *.xcodeproj

# Xcode automatically generates this directory with a .xcworkspacedata file and xcuserdata

# hence it is not needed unless you have added a package configuration file to your project

# .swiftpm

 

.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

 

 

# Accio dependency management

Dependencies/

.accio/

 

# 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

 

 

# Code Injection

# After new code Injection tools there's a generated folder /iOSInjectionProject

# https://github.com/johnno1962/injectionforxcode

 

 

### Xcode ###

# Xcode

# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore

 

 

 

 

## Gcc Patch

/*.gcno

 

### Xcode Patch ###

*.xcodeproj/*

!*.xcodeproj/project.pbxproj

!*.xcodeproj/xcshareddata/

!*.xcworkspace/contents.xcworkspacedata

**/xcshareddata/WorkspaceSettings.xcsettings

 

# End of https://www.toptal.com/developers/gitignore/api/swift,objective-c,xcode,cocoapods

 

1. cmd 창에서 적용할 프로젝트 폴더로 이동

2. vi .gitignore

-> 내용 붙여넣기 -> ESC -> :wq!

3. cat .gitignore 내용 확인

4. git status 

 

(이후로는 이미 ignore 파일들이 올라가있는 경우)

5. git rm --cached -r .

6. git add .

7. git commit -m "add ignore"

8. git push origin master

 

ignore 설정된 파일들이 제거되고 .gitignore이 추가된 것을 확인 할 수 있다.

 

 

 

 

반응형