I am trying to figure out how to modify my .gitignore file to work with this source tree.
The vendor code at one level and custom code in a folder under the custom code folder. Only the custom code needs to be committed, the vendor code needs to be ignored. So this is what I have in my .gitignore file and it works, for the most part:
hybris/bin/*
!hybris/bin/custom/
If I understand the two lines, the first say ignore EVERYTHING in hybris/bin, then the second one say, 'except for the custom folder'. There are a few files within the custom folder which need to exclude though: .springBeans and .project. When I do a git status, I am seeing this:
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
modified: hybris/bin/custom/cnbs/cnbsinitialdata/.springBeans
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: .gitignore
modified: hybris/bin/custom/cnbs/cnbscore/.springBeans
modified: hybris/bin/custom/cnbs/cnbsfacades/.springBeans
modified: hybris/bin/custom/cnbs/cnbsfulfilmentprocess/.springBeans
modified: hybris/bin/custom/cnbs/cnbsstorefront/.springBeans
modified: hybris/bin/custom/cnbs/cnbsstorefront/extensioninfo.xml
modified: hybris/bin/custom/cnbs/cnbstest/.springBeans
modified: hybris/config/.project
modified: hybris/config/tomcat/conf/catalina.properties
modified: hybris/config/tomcat/conf/server.xml
Untracked files:
(use "git add <file>..." to include in what will be committed)
hybris/bin/custom/cnbs/cnbsbackoffice/.classpath.bak
I have tried everything I can think of to get .springBeans and .project files to be excluded, but they never are. Any suggestions on how to get them to be excluded???
Here is my whole gitignore file:
# Folders to ignore at root(hybris)
hybris-sbg
installer
build-tools
c4c-integration
# Folders to ignore, whatever the place they are
.metadata
classes
hybris/bin/**/bin
gensrc
# Folders to ignore at the root of the repository
hybris/log/
hybris/temp/
hybris/data/
licenses/
hybris/hybris/sampleconfigurations/
# filter only custom extension
hybris/bin/*
!hybris/bin/custom/
# Absolute path to ignore
hybris/config/local.properties
# Filename patterns to ignore
*.class
build.xml
Generated*.java
platformhome.properties
*testclasses.xml
extensioninfo.xsd
*hmc.jar
hmc.xsd
items.xsd
beans.xsd
ruleset.xml
*.log
base.properties
SIGNATURE.SMF
package-lock.json
.DS_Store
.classpath
.project
*.swp
# Addon specific copy folders
**/_ui/addons
**/views/addons
**/tld/addons
**/tags/addons
**/messages/addons
*_bof.jar
**/.project
**/.springBeans