본문 바로가기
🛠️DevTools/Git

[Git] .gitignore 사용법

by inbeom 2023. 8. 27.
728x90

💡 .gitignore란?

Git 버전 관리에서 제외할 파일 목록을 지정하는 파일이다.

  • Git으로 프로젝트를 관리할 때, 그 프로젝트 안의 특정파일들은 Git으로 관리할 필요가 없는 경우가 있다.
  • .gitignore파일 안에 Git에서 제외할 파일의 경로나 확장자를 지정하면 Git에서 추적하지 않게 되며, commit&push를 할 때 해당 파일은 잡히지 않게 된다.
  • 프로젝트와 관련 없는 파일이나 주요 코드(api key, password등)가 작성된 파일을 숨기는데 사용할 수 있다.
  • 프로젝트 밑에 .gitignore란 이름으로 파일을 생성하면 된다.

 

Ex>

# Eclipse Gradle plugin generated files
# Eclipse Core
.project
# JDT-specific (Eclipse Java Development Tools)
.classpath

### Gradle Patch ###
# Java heap dump
*.hprof

# End of <https://www.toptal.com/developers/gitignore/api/intellij,intellij+all,intellij+iml,gradle,java>

**/front-end/node_modules/**
**/front-end/static/**
728x90

'🛠️DevTools > Git' 카테고리의 다른 글

[Git] Git 명령어  (0) 2023.08.27
[Git] Fork. Repository변경사항 업데이트  (0) 2023.08.27
[Git] Git과 Github의 차이  (0) 2023.08.27
[Git] Git이란?  (0) 2023.08.27
[Git] 에러노트  (0) 2023.08.27