티스토리 뷰

반응형

협업에서는 예전부터 소스관리 툴을 사용하고 있습니다. 대표적으로 사용되고 있는 Git 에서 필요없는 파일을 제외하고 Commit 할 수 있는 방법에 대해서 공유 드립니다.


.git 생성하는 방식은 소스관리하려는 파일 루트 위치로 이동 후 git init 으로 생성합니다.


$ git init


.git  이 생성되면 .gitignore도 생성할 수 있습니다. .gitignore에서 필요없는 파일을 등록하여 Git Commit 시 등록한 파일을 제외 할 수 있습니다.


$ nano .gitignore


vi 편집기 또는  nano 편집기로 gitignore의 포함할 항목을 넣을 수 있습니다. .gitignore에  어떤 파일을 제외하고 올려야하는지 판단하는데 어려울 것입니다. gitignore.io 에서는 원하는 gitignore에 포함할 대상을 검색하여 gitignore될 파일을 생성합니다.


gitignore.io에 접속 후 사용자가 Java, Swift 을 입력 한 다음 "Create" 버튼을 누르면 다음과 같이 보입니다.


[gitignore.io에서 Java, Swift 검색 화면]

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


### Java ###

# Compiled class file

*.class


# Log file

*.log


# BlueJ files

*.ctxt


# Mobile Tools for Java (J2ME)

.mtj.tmp/


# Package Files #

*.jar

*.war

*.ear

*.zip

*.tar.gz

*.rar


# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml

hs_err_pid*


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

.build/


# CocoaPods - Refactored to standalone file


# Carthage - Refactored to standalone file


# 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

fastlane/test_output



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



정리


협업에서 사용되는 소스관리툴에서 대표적으로 사용되는 Git의 ignore 파일 생성법에 대해서 알아봤습니다. gitignore.io에서 사용하는 프로그래밍언어를 입력 후 보다 안전하고, 깔끔한 소스 관리가 되기를 기대합니다.




참고


https://www.gitignore.io/

반응형

'팁(Tip) > 유용한 사이트' 카테고리의 다른 글

Homebrew 소개  (0) 2018.05.05
온라인 앱 테스트 사이트  (0) 2018.05.04
알고리즘 공부하기 좋은 사이트  (0) 2018.04.26
네이버 웹마스터 도구 사용법  (0) 2018.01.26
댓글