This should do the trick:
.DS_Store
/.project
When you provide the path to .gitignore, it applies it depending on where the .gitignore file is located (chroot if you want). Thus, / on the second line only means to ignore the file myfolder/.project.
source
share