굳이 포함할 필요가 없거나 보안상의 문제로 포함하지 말아야할때 Git의 관리에서 특정 파일/폴더를 배제한다.
.gitignore 파일을 사용해서 배제할 요소들을 지정할 수 있다.
중요한 문서를 만들고
git status 명령어를 입력하면
이렇게 뜨는 것을 확인할 수 있는데
이때 .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
더보기
# 이렇게 #를 사용해서 주석
# 모든 file.c
file.c
# 최상위 폴더의 file.c
/file.c
# 모든 .c 확장자 파일
*.c
# .c 확장자지만 무시하지 않을 파일
!not_ignore_this.c
# logs란 이름의 파일 또는 폴더와 그 내용들
logs
# logs란 이름의 폴더와 그 내용들
logs/
# logs 폴더 바로 안의 debug.log와 .c 파일들
logs/debug.log
logs/*.c
# logs 폴더 바로 안, 또는 그 안의 다른 폴더(들) 안의 debug.log
logs/**/debug.log
'Study' 카테고리의 다른 글
[JQuery] jquery 소스 사이트 (0) | 2023.03.19 |
---|---|
[Git/Github] 변화를 버전에 담기 (0) | 2023.02.19 |
[Git/Github] Git 설정 & 프로젝트 관리 시작하기 (0) | 2023.02.19 |
[Git/Github] 시작하기 (CLI vs GUI) (0) | 2023.02.19 |
[Git/Github] 시작하기 (설치와 세팅 - 윈도우) (0) | 2023.02.19 |