I have a problem managing my gitignore file. My git folder structure looks like this:
.gitignore
I want to ignore all target folders which is generated by maven build process, but not target package(inside Project2) and all files within the packge. I have tried to use this .gitignore:
target/
!Project2/src/main/java/target/
The above example is not working out for me.
The problem is that I have many packges and I dont want to explicit ignore the target folder for each one, but rather point out the target package not to ignore.
*** Renaming the package is not an option.
Try the following:
**/target/**
!**/src/**
The first line will add all targets while the second says to exclude src from the previous ignores.