I try to ignore file in a directory by relative path. E.g. I have several directories in working tree lib/file.f and I want all occurrences of this file to be ignored. I tried
lib/file.f
but this does not work.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Place
in your
.gitignore. This will cause git to ignore any file of the formproject/<DIR>/lib/file.f, assuming.gitignoreis in theprojectdirectory.To make git ignore
lib/file.ftwo directories down, you’d also have to addto the
.gitignore, and so on.Vastly simpler of course, would be to place
in
.gitignoreto block all files namedfile.f, but your question seems to suggest there is at least one file by that name you wish not to ignore.