I want my .gitignore to ignore certain folders and files so I came up with the following:
*.class
# usual java ignores
bin/
.metadata
# Maven
*/target/*
target/*
/target/
*/deploy/*
deploy/*
# src-gen folder is populated by the command of protobuf, these files should not be pushed
src-gen/*
# eclipse generated stuff
dependency-reduced-pom.xml
# we shouldn't have .jar files in our repository,
# apart from these 5 jars which are vital for our build process
*.jar
!/projectName/bundle/**/*.jar
# For Unix editors
# sometimes make file copies ending
# with ~
# To ignore them use:
*~
# For Mac
.DS_Store
._*
# For markdown read me files
.README.md.html
However, after a git status
I cannot see anything to be deleted as output. Note that this is a submodule, if that matters at all. And I want this .gitignore
to ignore everything without specifying any folder name, since I don't want any hardcoding.
Here is the folder structure I have:
+ parentRepo
+ thisRepo
+ .gitignore
+ projectName
+ src-gen
+ target
+ deploy
+ dependency-reduced-pom.xml
+ bundle
+ system
+ 1.jar
+ 2.jar
+ 3.jar
+ 4.jar
+ 5.jar