Skip to content

Git:Ignore

.gitignore파일은 버전관리 대상에서 제외될 파일을 관리할 수 있도록 도와주는 예약된파일이다.

Categories

How to use

패턴은 아래 규칙을 따른다:

  • 아무것도 없는 줄이나, #로 시작하는 줄은 무시한다.
  • 표준 Glob 패턴을 사용한다.
  • 디렉토리는 슬래시(/)를 끝에 사용하는 것으로 표현한다.
  • 느낌표(!)로 시작하는 패턴의 파일은 무시하지 않는다.

**/ 스타일의 문법은 Git 1.8.2 버전부터 사용할 수 있다.

Two consecutive asterisks ("**") in patterns matched against full pathname may have special meaning:

  • A leading "" followed by a slash means match in all directories. For example, "/foo" matches file or directory "foo" anywhere, the same as pattern "foo". "**/foo/bar" matches file or directory "bar" anywhere that is directly under directory "foo".
  • A trailing "/" matches everything inside. For example, "abc/" matches all files inside directory "abc", relative to the location of the .gitignore file, with infinite depth.
  • A slash followed by two consecutive asterisks then a slash matches zero or more directories. For example, "a/**/b" matches "a/b", "a/x/b", "a/x/y/b" and so on.

Git ignore partten

예외 처리 패턴에 대하여 열거한다.

  • General: 일반적인 예외처리 방법.
[Bb]uild
[Oo]bj
[Bb]in
*.o
[Dd]ebug*
[Rr]elease*
*.mode*
*.app
*.pyc
.svn
*.log
*.cpp.eep
*.cpp.elf
*.cpp.hex

IDE Setting

IDE에 사용될 경우 필요한 예외처리 목록이다.

  • XCode IDE
*.pbxuser
*.perspective
*.perspectivev3
*.mode1v3
*.mode2v3
# XCode 4
xcuserdata
*.xcworkspace
  • Code::Blocks
*.depend
*.layout
  • Visual Studio
*.sdf
*.opensdf
*.suo
*.pdb
*.ilk
*.aps
ipch/
  • Eclipse
.metadata
local.properties
.externalToolBuilders

OS

OS별 특수파일 목록에 대하여 열거한다.

  • Linux
*~
# KDE
.directory
.AppleDouble
  • OSX
.DS_Store
*.swp
*~.nib
# Thumbnails
._*
  • Windows
# Windows image file caches
Thumbs.db
# Folder config file
Desktop.ini

Favorite site