.gitignore 적용하기

2021. 8. 3. 18:50·Git

프로젝트 작업 시 로컬 환경의 정보나 빌드 정보 등, 원격 저장소에 관리하지 말아야 되는 파일들에 대해 지정하여 원격 저장소에 실수로 올리가지 않도록 관리하는 파일

 

작성 패턴

- '#'로 시작하는 라인은 무시한다. 

- 표준 Glob 패턴을 사용한다. 

- 슬래시(/) 시작하면 하위 디렉토리에 적용되지 않는다.

- 디렉토리는 슬래시(/)를 끝에 사용하는 것으로 표한한다. 

- 느낌표(!)로 시작하는 패턴의 파일은 무시하지 않는다.

 

Example

# ignore all .class files
*.class

# exclude lib.class from "*.class", meaning all lib.class are still tracked
!lib.class

# ignore all json files whose name begin with 'temp-'
temp-*.json

# only ignore the build.log file in current directory, not those in its subdirectories
/build.log

# specify a folder with slash in the end
# ignore all files in any directory named temp
temp/

# ignore doc/notes.txt, but not doc/server/arch.txt
bin/*.txt

# ignore all .pdf files in the doc/ directory and any of its subdirectories
# /** matches 0 or more directories
doc/**/*.pdf

 

'Git' 카테고리의 다른 글

이미 push한 commit 메시지 변경  (0) 2022.02.09
Git-Commit Message Convention  (0) 2021.07.31
git 초보를 위한 fork, pull request 방법  (0) 2021.06.15
'Git' 카테고리의 다른 글
  • 이미 push한 commit 메시지 변경
  • Git-Commit Message Convention
  • git 초보를 위한 fork, pull request 방법
사랑우주인
사랑우주인
  • 사랑우주인
    lovelyAlien
    사랑우주인
  • 전체
    오늘
    어제
  • 글쓰기
    관리
    • 분류 전체보기 (209)
      • Programming (4)
        • Spring (28)
        • Java (46)
        • JPA (2)
        • 디자인 패턴 (5)
        • 개발&아키텍처 (0)
      • Network (14)
      • OS (19)
      • Database (1)
      • Kubernetes (0)
      • Kafka (2)
      • Algorithm (49)
        • BaekJoon (1)
        • Programmers (19)
        • Algorithm (5)
        • Socar (2)
        • LeetCode (19)
      • Interview (2)
      • Issues (2)
      • DotJoin (1)
      • Git (4)
      • 독서 (3)
      • 끄적끄적 (1)
      • 외부활동 (26)
        • 항해플러스 (2)
        • JSCODE 네트워크 (19)
        • JSCODE 자바 (5)
      • SQL (0)
  • 블로그 메뉴

    • 홈
    • 태그
    • 방명록
    • GitHub
  • 링크

  • 공지사항

  • 인기 글

  • 태그

    fcfs
    Reorder List
    socar
    @JsonNaming
    lower bounded wildcards
    minimum number of arrows to burst balloons
    JSCode
    LinkedList
    디자인 패턴
    AuthenticationSuccessHandler
    RR
    algorithm
    wildcards
    운영체제
    pacific atlantic water flow
    rotting oranges
    clone graph
    제네릭
    Oauth2
    OS
    Process
    트랜잭션
    준영속 엔티티
    Climbing Stairs
    Thread
    @JsonProperty
    Generic
    BFS
    추상화 클래스
    runner 기법
  • 최근 댓글

  • hELLO· Designed By정상우.v4.10.1
사랑우주인
.gitignore 적용하기
상단으로

티스토리툴바