PROBLEM
There many different .gitignore files into your project.
The “.gitignore” seams not working at all.
Your pull like commands comes with “ignored files”.
SOLUTION
- Create a .gitignore pattern.
- Fix your repository’s .gitignore file into master, at least.
Same to develop or another branch. - After updating or merging your local stuff, check the .gitignore content.
If the local .gitignore file is not like the pattern, just overwrite it with the pattern file.
If your project is too messy, simply overwrite local using the pattern as a “just after procedure”, to make sure. - Avoid having more than one .gitignore file.
Set just one under the project’s root dir.
In most of all usual cases, is enough. - If the file is already staged, the git may NOT ignore it eventhough is registered in .gitignore.
To fix this, move the files to another temporary place, commit and move back, then commit again.
You may track the git behavior using the “git status” after each operation.
You’ll see that the files to be ignored will disappear.
.gitignore Example of a Java Project With Sonar and Docker files.
# Add any directories, files, or patterns you don't want to be tracked by version control # ECLIPSE'S **/target **/.settings **/.apt_generated **/.metadata *.classpath *.factorypath *.project *.class *.tern-project # PROJECT'S STUFF *.Jenkinsfile *.JenkinsfileTeste *.arquivoPdf.txt *.arquivoPng.txt *.arquivoXls.txt *.axis.log # TO BE USED TO LOG REPORTS AND MAINTENANCE *.log.out
#WHY .GITIGNORE SEEMS TO FAIL
Follow the figures below.
After fixing .gitignore file:
Another reason why .gitignore fails is caused by a “conflicting state”.

Brazilian system analyst graduated by UNESA (University Estácio de Sá – Rio de Janeiro). Geek by heart.