Tuesday, 19 April 2016

How to ignore files for being tracked in Git ?


Create a file with name .gitignore
$ cat .gitignore


Provide the patterns of files that you don’t want to automatically add or show as untracked.

Example
# ignore .txt files
*.txt

# but do track hello.txt, even ignoring .txt files above
!hello.txt

# ignore all files in the build/ directory
build/

# ignore the README file in the current directory, not subdir/README /README # ignore all PPT files in doc directory, but not PPT files under doc/subdir/ doc/*.ppt # ignore all .txt files in the doc directory and its subdir doc/**/*.txt


https://github.com/github/gitignore

No comments:

Post a Comment

Note: only a member of this blog may post a comment.