Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Magento 1.x .gitignore
# Never save database creditentials in your repo. Keep a dummy copy with a different name eg "local.xml.dev"
app/etc/local.xml
downloader
# If you'd like to keep the downloader, use the following instead:
# downloader/.cache
# downloader/cache.cfg
# downloader/connect.cfg
# All of the var folders can be excluded.
var/*
!var/.htaccess
# Remove generated files
includes/*
!includes/.htaccess
media/*
# If you'd like to commit media files, replace the above with the following:
# media/catalog/product/cache
# media/css
# media/css_secure
# media/js
# media/js_secure
# I use a global gitignore file for the following, but worth noting these:
.DS_Store
.phpstorm.meta.php
.idea/
.modman
# Don't commit composer dependencies:
composer/
@ashsmith

This comment has been minimized.

Copy link
Owner Author

ashsmith commented Jul 25, 2012

With Magento some people tend to exclude everything except for their theme package i.e app/design/frontend/[package]/[theme] & skin/frontend/[package]/[theme]

This is fine, however I prefer having a full working installation in my Magento repos, and just exclude the items that change (i.e. local.xml, cache, and logs). Then all your team members need to do is pull the repo, and away they go. If like me you use a shared database, you can remove local.xml from your .gitignore and it removes even more complications of getting other team members set up!

Only real draw back is you'll have a larger repo, which is a small price.

@eyemagine2

This comment has been minimized.

Copy link

eyemagine2 commented Sep 11, 2013

For the var dir I prefer

/var/*
!/var/.htaccess
@petrica

This comment has been minimized.

Copy link

petrica commented Nov 4, 2013

What about includes/src ? This directory is generated when you enable magento compilation.

@bfan74

This comment has been minimized.

Copy link

bfan74 commented Dec 18, 2014

Thanks for putting this out!
Was wondering exactly what to ignore, as we like to have a complete working Magento installation in the repo as well.

@metame

This comment has been minimized.

Copy link

metame commented Jan 28, 2016

Tried this with Magento 1.9.x and still seems it's wanting me to go through Magento install when I open.

@ashsmith

This comment has been minimized.

Copy link
Owner Author

ashsmith commented Jan 26, 2017

Updated, as it hasn't been touched since July 2012. Thanks for the suggestions everyone. Keep 'em coming.

@al1357

This comment has been minimized.

Copy link

al1357 commented Jul 24, 2018

What about ignoring maintenance.flag?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.