Skip to content

Instantly share code, notes, and snippets.

@erfanimani
Last active June 1, 2019 10:22
Show Gist options
  • Save erfanimani/8856964 to your computer and use it in GitHub Desktop.
Save erfanimani/8856964 to your computer and use it in GitHub Desktop.
A refactored and modern .gitignore for Magento. Compatible for Git versions 2.7.0+. See this revision to use it for versions lower than 2.7.0: https://gist.github.com/erfanimani/8856964/886f5d79d229c21b9c712155c362e5fc1c61a12a
### MAGENTO DIRECTORIES
# Note: because of the wildcards/asterisks used, you can't do "git clean -fd ." without
# clearing everything in media and var. Also see http://stackoverflow.com/a/19442789/896657
# Ignore everything in media, except for the htaccess files
# Also include the Lazy Catalog Images (LCI) .htaccess if that's installed
# (https://github.com/AOEpeople/Aoe_LazyCatalogImages)
/media/*
/media/*/*
/media/*/*/*
/media/*/*/*/*
!/media/customer/.htaccess
!/media/downloadable/.htaccess
!/media/.htaccess
!/media/catalog
!/media/catalog/product
!/media/catalog/product/LCI
!/media/catalog/product/LCI/.htaccess
# If you want, you can ignore the downloader completely
# See http://magento.stackexchange.com/a/16513
# /downloader
# Ignore downloader cache and configuration files
/downloader/.cache/
/downloader/cache.cfg
/downloader/connect.cfg
# Ignore var directory, except for the htaccess file
/var/*
!/var/.htaccess
### CONFIGURATION
# These are specific to each environment
/app/etc/local.xml
/errors/local.xml
/app/etc/enterprise.xml
/.htaccess
### MAGENTO MISC FILES
# .htaccess.sample and index.php.sample are used for creating new stores, so lets keep these.
# Also, patches might not apply cleanly if you don't have those files
# /.htaccess.sample
# /index.php.sample
/install.php
README
RELEASE_NOTES.txt
/php.ini.sample
sweet_tooth_license.txt
EVOLVED_EULA.rtf
/pkginfo/
/maintenance.flag
/includes/src/*
### TEMPORARY FILES
*~
### SNAPSHOT DUMPS
/snapshot/
### CSS AND SASS CACHE
# Ignore SASS cache and CSS except for base, default and RWD since these might be used in fallbacks
# Comment this whole section out if you're not using SASS
.sass-cache/
/sass-cache/
/skin/frontend/*/*/css/
!/skin/frontend/base/default/css/
!/skin/frontend/default/default/css/
!/skin/frontend/rwd/default/css/
### BUNDLER
# If you're using bundler to manage Gems (like Sass, Compass, etc)
/.bundle/
### NPM
/npm-debug.log
/node_modules
### IDE'S AND/OR CI
.DS_Store
Thumbs.db
*.sublime-project
*.sublime-workspace
/.idea
/.buildpath/
/.project/
/.settings/
/nbproject/
/module_sources/
/database_dumps/
.externalToolBuilders
*.scc
### TESTING
/firegento.php
### MODMAN
/.modman/
### COMPOSER
# Comment out if you're not using Magento hackathon's copy deploystrategy
/vendor/
### PROJECT SPECIFIC
# add your project specific gitignore entries here
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment