1. .gitignore 파일이란?
모듈과 관련된 파일이나 보안적인 이슈가 있는 파일들을 git 관리 대상에서 제외시키는 파일이다.
2. 사용법
github에서 레포지토리 생성 시 초기화를 통해 만들 수 있다.
만약 처음에 만들지 못했더라면 만들고자 하는 directory에서 다음과 같은 명령어를 통해 만들 수 있다.
touch .gitignore
2 - 1) 문법
# : comments
# no .a files
*.a
# but do track lib.a, even though you're ignoring .a files above
!lib.a
# only ignore the TODO file in the current directory, not subdir/TODO
/TODO
# ignore all files in the build/ directory
build/
# ignore doc/notes.txt, but not doc/server/arch.txt
doc/*.txt
# ignore all .pdf files in the doc/ directory
doc/**/*.pdf
'Collaboration Tools > Git과 Github' 카테고리의 다른 글
git branch, merge (0) | 2020.12.22 |
---|---|
git init, add, commit, clone, push, pull (0) | 2020.12.16 |