Saturday, June 16, 2018

git: Resolving .gitignore issue in a messy project

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
  1. Create a .gitignore pattern.
  2. Fix your repository's .gitignore file into master, at least.
    Same to develop or another very used branch.
  3. 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.
  4. Avoid having more than one .gitignore file.
    Set just one under the project's root dir.
    In most of all usual cases, is enough.

.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

#WHY .GITIGNORE SEEMS TO FAIL

Follow the figures below.




After fixing .gitignore file:




Another reason when .gitignore fails is caused by a "conflicting state".



*.log.out
 @FROM: my alternative site

eclipse: java: SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder" or Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/impl/StaticLoggerBinder

  >PROBLEM Using Eclipse, you try to run a simple logging test using "org.slf4j.Logger" like the sample below: package Test; im...