사용이유
- 보안, 개인적 파일 유출방지
- 빌드 과정 부산물 관리 불필요 *
* 빌드 과정 부산물
- 개발 환경의 임시 파일, 테스트 출력 및 로그 등
.gitignore 자동 생성 사이트
- 본인이 사용하는 프로젝트의 환경을 입력
https://www.toptal.com/developers/gitignore
gitignore.io
Create useful .gitignore files for your project
www.toptal.com
.gitignore 형식
https://git-scm.com/docs/gitignore
Git - gitignore Documentation
The optional configuration variable core.excludesFile indicates a path to a file containing patterns of file names to exclude, similar to $GIT_DIR/info/exclude. Patterns in the exclude file are used in addition to those in $GIT_DIR/info/exclude.
git-scm.com
1. 모든 파일 무시
# 모든 file.c
file.c
2. 프로젝트 최상위 폴더의 파일 무시
# 최상위 폴더의 file.c
/file.c
3. 모든 파일의 특정 확장자 무시
# 모든 .c 확장자 파일
*.c
4. 무시할 파일 제외
# .c 확장자지만 무시하지 않을 파일
!not_ignore_this.c
5. 특정 이름의 파일 또는 폴더와 그 내용들 무시
# logs란 이름의 파일 또는 폴더와 그 내용들
logs
6. 특정 이름의 폴더와 그 내용들 무시
# logs란 이름의 폴더와 그 내용들
logs/
7. 폴더 바로 안의 내용물 무시
# logs 폴더 바로 안의 debug.log와 .c 파일들
logs/debug.log
logs/*.c
8. 폴더 내부의 내용물 무시
# logs 폴더 바로 안, 또는 그 안의 다른 폴더(들) 안의 debug.log
logs/**/debug.log
'DevOps > Git' 카테고리의 다른 글
[Git] 기초 사용법 복습 (0) | 2022.10.23 |
---|---|
[Git] Git 초기설정 (VisualStudio Code) (0) | 2022.10.22 |
[Git] 소스트리, 깃데스크탑 소스코드 한글 깨짐 (0) | 2022.10.12 |
[Git] git revert 주의사항 (0) | 2022.10.10 |
[Git] git commit 메시지 규칙 (0) | 2022.10.09 |