git
Block 2.1: Ignoring things: .gitignore
.gitignore
🙈.gitignore
.gitignore
and if it matches, git will ignore the file.gitignore
file itself is tracked just like any other file.gitignore
: classic examplesIgnore every file called myfile.pdf
Ignore the file called myfile.pdf in the folder reports at the root of your repository
Ignore all PDF files
Tip
The .gitignore uses the same kind of pattern matching as git add
(or other git commands)
.gitignore
: global vs. local 🫥.gitignore
files at different levels.gitignore
, that will work across your whole computer.gitignore
files at https://github.com/github/gitignore..DS_Store
files on macOS.Once a file is tracked by git
, adding it to the .gitignore
will not do anything.
git rm --cached <file>
git-exercise
git-exercise
directoryAny Questions?