[TYPO3-dev] Best practice: How to store a complete TYPO3 installation in git

Adrien Crivelli adrien.crivelli at gmail.com
Mon May 13 06:01:24 CEST 2013


Hi,

Here, we heavily use git submodules. One website is a repository and each
extensions is a submodule. The exception is for "speciality" which an
extension specific for the current project, hence it is part of the the
"main" repository, not as submodule. Having a common name for all our
projects where we put "custom" code makes it easy to find what you need
quickly.

Also, we exclude "heavy" resources uploaded by user, which are not
essential to the website functionality/design (/fileadmin/user_upload). And
finally we opted to symlink to a centralized version of TYPO3, which itself
is of course a git clone.

So our .gitignore typically is:

/.*
> /htdocs/build.xml
> /htdocs/fileadmin/_temp_/
> /htdocs/fileadmin/user_upload/
> /htdocs/.htaccess
> /htdocs/typo3conf/ENABLE_INSTALL_TOOL
> /htdocs/typo3conf/ext/speciality/nbproject/private/
> /htdocs/typo3conf/l10n/
> /htdocs/typo3conf/localconf.php
> /htdocs/typo3conf/*.log
> /htdocs/typo3conf/temp*
> /htdocs/typo3_src
> /htdocs/typo3temp/
> /htdocs/uploads/
> /logs
> /nbproject/private/


In addition of that, we have a collection of PHP scripts ("t3tools")
for miscellaneous tasks. The main one would be:

   - t3clearcache: clear all cache, in database and files system
   - t3database: execute SQL
   - t3import: import an entire project from our server to a local copy
   for development purpose
   - *t3resetdatabase*: import the production database into our local copy
   - t3update: update an extension (git submodule) to the given commit for
   all our websites

As t3resetdatabase may hint, our workflow implies to have a maximum of
changes in versionned files, since we sync the database only in one way:
production to dev. Every database modification needs to be tested on dev,
and then manually replicated on production. I am a die-hard believer of
"never work on production and version everything".

But this workflow may be slightly cumbersome for co-workers, and they
sometimes prefer to do live modifications. Luckily we also use git for
publishing, so we can easily commit/push from production as well. So it's
usually not such a big issue (except it hurts my feelings ;-) ).

Also this is a good place to mention https://github.com/TYPO3-Extensions, a
read-only mirror of (almost) all TYPO3 extensions. We created it for our
own need, and recently upgraded it to include more extensions, and make it
run from TYPO3 servers directly for better performance.

And finally, I would suggest you all have a look at
https://github.com/Ecodev/bootstrap_package, which is a TYPO3 6.0 based
introduction package of what I described (more or less). Heavily relying on
Twitter Bootstrap and Fluid.

Cheers,

Adrien



More information about the TYPO3-dev mailing list