I use PhpStorm as my IDE and it sets up .gitignore
file in a directory called .idea
. There are folders and files that I want to ignore but I can't go to previous folder no matter what.
Lets have file called example.txt
. The folder tree looks like this:
- /Project
- /.idea
- .gitignore
- workspace.xml
- /src
- example.txt
How do I ignore example.txt
file? I tried ../src/example.txt
, src/example.txt
, /../src/example.txt
.gitignore
applies to a directory and its subdirectories.
it does not apply to a sibling or parent directory.
to ignore the src/example.txt
you could:
create a .gitignore
file in the src/
directory, containing e.g.
example.txt
create a .gitignore
file in the parent directory, containing e.g.
src/example.txt