.gitignore file for dev environment

Hello!
Anobody have .gitignore file for OXID 6? I would like to save oxid instance without unneceserly files like out/…, etc…

Something like this:
https://oxidforge.org/de/?s=gitignore
just for newer version?

Thanks!

1 Like

Changed the URL in post as the original link wasn’t like intended to be - corrected it on OXIDforge.

However, we may use this thread to collect all to-be-ignored files in a present version, may not we? Every wee bit is welcome.

1 Like

ofcourse we can :slight_smile:

1 Like

I ended up with this:

#ignore everything but composer files
/*
!/composer.json
!/composer.lock
!/.gitignore

Then you can restore the shop with composer install. This also works for themes and modules installed by composer. For other themes and modules, i used the following:

#folder structure
!/source/
/source/*
!/source/modules/
/source/modules/*
!/source/out/
/source/out/*
!/source/Application/
/source/Application/*
!/source/Application/views/
/source/Application/views/*

#legacy modules
!/source/modules/vendor/
/source/modules/vendor/*
!/source/modules/vendor/module/

#legacy themes
!/source/Application/views/theme/
!/source/out/theme/

I did not find any other way of whitelisting a deep folder than this, it works but looks too complicated to me.

2 Likes

@leofonic
Hmmm… it looks quite ok but… i have problem with understanding your concept of git flow on dev env.
Could you tell me how is your composer.json file looks like on local dev vm?
How looks your install process of your modules with git?

At this moment on local vm i have to use manual “git clone” to “source/modules/vendorfolder/” and manual add:
"autoload": {
“psr-4”: {
“Vendor\ModuleName\”: “./source/modules/vendorfolder/modulename”,
}
},

to main composer.json for each my module.

I tried to use “composer config repositories.xxxxxx” + “composer require” + composer update" solution but then it downloads module/s to “oxvm_base/vendor/” catalog and there are all “.git” folders and if i am a developer i need all “.git” folders from my modules in “source/modules/vendorfolder/modulename”… and this is a problem for me in understaning how you are using “composer install” to restore shop. Of course when we are using only external modules it will works well. But on dev environment?

When i am using “composer require” solution (not manual) on local vm, phpstorm shows me some new remote branches with prefix “composer”: composer/master, composer/development…
composer%20branches
Maybe “origin/master” is repo from bitbucket and “composer/master” id from “oxvm_base/vendor/” catalog?

P.S. I am using “composer config repositories.xxxxxx” + “composer require” + composer update" only on production server.

1 Like

This gives you a separate module repo for each module so you can work on each module. Once the module is ready it can be installed with composer.

I don’t really understand what you are trying to achieve then by having a repository for the whole shop. What kind of changes do you want to track there?