.gitignore file should be at root of the project with following pattern,
- Add the file name like project.settings to ignore it
- If we need to ignore multiple files with same extensions we can use *.settings
- If we need to ignore multiple files in a directory with same extensions we can use /src/*.xml
- If we needs to ignore a directory with its all contents, we can use /bin/*
my .gitignore:
/bin/*
/gen/*
/results/*
*.class
*.log
*.png
.project
.classpath
.hg
.settings