3

I would like to exclude .DS_Store tracking from myfolder and all subfolders. I also want to exclude a .project file from myfolder (but not from its subfolders).

What should I write in .gitignore (situated in myfolder)?

.DS_Store # or *.DS_Store ? I mean, is the asterisk necessary?
./.project # is this syntax correct?

1 Answer 1

5

This should do the trick:

.DS_Store
/.project

When you a provide a path to .gitignore, it applies it based on where the .gitignore file is (a chroot, if you will). So the / on the second line means only ignore the myfolder/.project file.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.