gitignore - 의도적으로 추적되지 않은 파일을 무시하도록 지정하기

 

github 에 push 할 때 100Mb 이상인 파일이 있으면 push가 되지 않는다

이런 경우, 해당 파일 제외하고 add, commit, push 할 때 사용하는 gitignore!

 

 

[ 사용 방법 ]

 

1) .git 이 포함된 폴더 / git이 실행되는 폴더에 .gitignore(파일이름+확장자이름) 파일을 만든다.

 

2) .gitignore 파일 편집에서 제외하고 싶은 파일 이름 / 패턴을 적어주고 저장한다.

    # : 주석 처리용

 

3) .gitignore 파일을 git 에 add -> commit 한다.

다른 작업 후 add, commit 할 때 .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

 

 

 

+ Recent posts