Put .gitignore in the working directory. It doesn't work if you put it in the .git (repository) directory $ ls -1d .git* .git .gitignore