I am working on a maven project and I want to ignore the files generated and stored in the /target folder of my project (Evaluation) root folder.In the root of my git repository
In addition to the answers already provided above, also note that the .gitignore file will not work if it is not in the root folder.
I had a project where .gitignore was here /projectname/.gitignore and therefore was not being read. So I moved it to /.gitignore and all was well again.