-
[Git] .gitignore ํ์ผ ์์ฑํ๊ธฐGit 2022. 1. 9. 22:30
.gitignore ํ์ผ์ git์์ ํน์ ํ์ผ์ ์ถ์ ๋์ง ์๋ ์ํ๋ก ์ ์งํ๊ธฐ ์ํด ์ฌ์ฉํ๋ค.
์ฆ, git์ ํฌํจ์ํค์ง ์์ ํ์ผ์ ์ค์ ํ ๋ ์ฌ์ฉํ๋๋ฐ
๋ณดํต ์คํ ํ์ผ, ๋ก๊ทธ ํ์ผ, ๋ฌธ์ ํ์ผ, ํจํค์ง ํ์ผ ๋ฑ์ ํฌํจ์์ผ์ค๋ค.
์ด์ ํ์ผ์ ์์ฑํด๋ณด๋๋ก ํ์.
๋จผ์ ์๋ ์ฌ์ดํธ์ ์ ์ํ๋ค.
gitignore.io
Create useful .gitignore files for your project
www.toptal.com
์๋ ์ฌ์ง์ฒ๋ผ Swift, Xcode, CocoaPods๋ฅผ ์ ๋ ฅํ๊ณ ํ์ผ์ ์์ฑํ๋ค.

์์ฑ ๋ฒํผ์ ๋๋ฅด๋ฉด, ์๋์ ๊ฐ์ ํ์ผ์ด ์์ฑ๋๋๋ฐ ์ด๋ฅผ ์ ๋ถ ๋ณต์ฌํ๋ค.

ํ์ผ ๋ด์ฉ์ ๋ฐ์ ํด๋ฆญ!
๋๋ณด๊ธฐ.gitignore
# Created by https://www.toptal.com/developers/gitignore/api/swift,xcode,cocoapods # Edit at https://www.toptal.com/developers/gitignore?templates=swift,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/ ### Swift ### # 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 ## 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 Carthage/Build/ # 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 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/ ### 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,xcode,cocoapodsํ์ผ์ ๋ณต์ฌํ ํ์, ํฐ๋ฏธ๋์์ ๋ช ๋ น์ด๋ฅผ ์ ๋ ฅํด์ vi ํธ์ง๊ธฐ๋ก ๋ค์ด๊ฐ๋ค.
vi .gitignoreํ์ผ์ด ์ด๋ฆฌ๋ฉด, i ํค๋ฅผ ๋๋ฌ์ INSERT ๋ชจ๋๋ก ๋ฐ๊พผ ํ์ ํ์ผ์ ํธ์งํ๋ฉด ๋๋ค.

๋ณต์ฌํ ํ์ผ์ ๋ถ์ฌ๋ฃ๊ธฐํ ํ์ ESCํค๋ฅผ ๋๋ฌ์ ์ ๋ ฅ์ ๋ฉ์ถ๊ณ , :wq!๋ฅผ ์ ๋ ฅํ์ฌ ํธ์ง๊ธฐ๋ฅผ ์ข ๋ฃํ๋ค.

์ฌ๊ธฐ๊น์ง ์๋ฃํ๋ฉด .gitignore ํ์ผ ์ถ๊ฐ๊ฐ ์๋ฃ๋๋ค.
'Git' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[Git] Git commit message ํ ํ๋ฆฟ ๋ง๋ค๊ธฐ (0) 2022.05.24 [Git] Found a swap file by the name ํด๊ฒฐ ๋ฐฉ๋ฒ (0) 2022.03.31 [Git] error: 'ํด๋์ด๋ฆ/~' does not have a commit checked out ํด๊ฒฐ๋ฐฉ๋ฒ (0) 2022.02.27 [Git] ์ด๋ฏธ pushํ ์ปค๋ฐ ๋ฉ์์ง ๋ณ๊ฒฝํ๊ธฐ (0) 2022.01.05