# [Git] .gitignore μ„€μ •

img

# 1️⃣ μ™œ ν•„μš”ν• κΉŒ?

Git으둜 ν˜•μƒκ΄€λ¦¬λ₯Ό ν•˜λ©΄μ„œ 원격저μž₯μ†Œμ— Pushν•˜κ³  싢지 μ•Šμ€ λΆˆν•„μš”ν•œ fileλ“€ 쑴재

  • EX) API KEY κ°’, log file, imi file, 둜컬 개발 ν™˜κ²½ setting에 κ΄€λ ¨λœ file λ“±

.gitignore file둜 λͺ©λ‘μ„ μž‘μ„±ν•΄μ£Όλ©΄ Git μ €μž₯μ†Œλ‘œ Commit. Push λ˜μ§€ μ•Šλ„λ‘ ν•΄μ€€

# 2️⃣ 기본적인 μž‘μ„±λ°©λ²•

  • *Β λŠ” λ¬Έμžκ°€ μ‘΄μž¬ν•˜μ§€ μ•Šκ±°λ‚˜ ν•œ 개 이상이 μžˆλŠ” 것을 의미

  • **Β λŠ” ν•˜μœ„ 폴더λ₯Ό 의미

    β†’ 예λ₯Ό λ“€μ–΄Β A/**/ZλŠ”Β A/B/ZΒ ,Β A/B/C/ZΒ ,Β A/D/ZΒ λ“±μ˜ ν˜•νƒœμ˜ 폴더듀 νƒμƒ‰ν•˜κ²Œ λœλ‹€.

  • []Β λŠ” μ€‘κ΄„ν˜Έ μ•ˆμ˜ ν•œ κΈ€μžλ₯Ό 의미

    β†’ 예λ₯Ό λ“€μ–΄ [abc] : a λ˜λŠ” b λ˜λŠ” c λ²”μœ„ 지정 κ°€λŠ₯ β†’ [0–9] : 0λΆ€ν„° 9κΉŒμ§€

  • ν‘œμ€€ Glob Pattern을 μ‚¬μš©

    β†’ Shellμ—μ„œ μ‚¬μš©ν•˜λŠ” κ°„λž΅ν™” 된 μ •κ·œ ν‘œν˜„μ‹

  • /Β λΆ€ν„° μ‹œμž‘ν•˜λŠ” 경둜 νŒ¨ν„΄μ€ ν•˜μœ„ 디텍토리 μ—μ„œ 반볡적으둜 μ μš©ν•˜μ§€ μ•ŠμŒ

  • ! 둜 μ‹œμž‘ν•˜λŠ” νŒ¨ν„΄μ€ gitignoreμ—μ„œ μ œμ™Έ(λ¬΄μ‹œλ˜μ§€ μ•ŠμŒ!)

  • 곡백 라인 λ˜λŠ”Β # 으둜 μ‹œμž‘ν•˜λŠ” 라인은 κ·œμΉ™ λ¬΄μ‹œ (주석과 같은 의미)

# 3️⃣ gitignore μžλ™ 생성 μ‚¬μ΄νŠΈ

μ–Έμ–΄, 운영체제, IDE, λΉŒλ“œ 도ꡬ 정도λ₯Ό μΆ”κ°€

# Created by https://www.gitignore.io/api/java,macos,gradle,intellij
# Edit at https://www.gitignore.io/?templates=java,macos,gradle,intellij

### Intellij ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf

# Generated files
.idea/**/contentModel.xml

# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml

# Gradle
.idea/**/gradle.xml
.idea/**/libraries

# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn.  Uncomment if using
# auto-import.
# .idea/modules.xml
# .idea/*.iml
# .idea/modules
# *.iml
# *.ipr

# CMake
cmake-build-*/

# Mongo Explorer plugin
.idea/**/mongoSettings.xml

# File-based project format
*.iws

# IntelliJ
out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Cursive Clojure plugin
.idea/replstate.xml

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

# Editor-based Rest Client
.idea/httpRequests

# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser

### Intellij Patch ###
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721

# *.iml
# modules.xml
# .idea/misc.xml
# *.ipr

# Sonarlint plugin
.idea/**/sonarlint/

# SonarQube Plugin
.idea/**/sonarIssues.xml

# Markdown Navigator plugin
.idea/**/markdown-navigator.xml
.idea/**/markdown-navigator/

### Java ###
# Compiled class file
*.class

# Log file
*.log

# BlueJ files
*.ctxt

# Mobile Tools for Java (J2ME)
.mtj.tmp/

# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar

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

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

### Gradle ###
.gradle
build/

# Ignore Gradle GUI config
gradle-app.setting

# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle-wrapper.jar

# Cache of project
.gradletasknamecache

# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898
# gradle/wrapper/gradle-wrapper.properties

### Gradle Patch ###
**/build/

# End of https://www.gitignore.io/api/java,macos,gradle,intellij

# Reference

Last Updated: 6/18/2023, 2:13:15 PM