Skip to content

Instantly share code, notes, and snippets.

@prestarocket
Last active July 19, 2023 16:04
Show Gist options
  • Save prestarocket/7870db5cbba8b841faf08563e11c0249 to your computer and use it in GitHub Desktop.
Save prestarocket/7870db5cbba8b841faf08563e11c0249 to your computer and use it in GitHub Desktop.
Gitignore PrestaShop 1.7
# Cache, temp and personal files
/.htaccess
*.log
npm-debug.log.*
.sass-cache/
/cache/*
download/*
/img/*
/log/*
/upload/*
/vendor/*
!/vendor/.htaccess
docs/phpdoc-sf/
composer.lock
tests/Selenium/errorShots/
tests/Selenium/errorDumps/
/admin*/autoupgrade/*
/admin*/backups/*
/admin*/import/*
/admin*/import/*
!/admin*/import/.htaccess
!/admin*/import/index.php
themes/*/cache/*
# Config
config/settings.inc.php
config/settings.old.php
config/xml/*
config/themes/*
!config/xml/themes/default.xml
tests/Selenium/settings.js
themes/*/config/settings_*.json
app/config/parameters.old.yml
app/config/config.php
# Themes, modules and overrides
!modules/*
modules/config_*.xml
modules/ps_imageslider/images/*
!modules/ps_imageslider/images/index.php
modules/ps_banner/img/*
!modules/ps_banner/img/index.php
!override/*
/themes/StarterTheme
# Vendors and dependencies
bower_components/
node_modules/
composer.phar
php-cs-fixer
.grunt/*
# Translations and emails templates
translations/*
mails/*
!mails/fr/
themes/default-bootstrap/lang/*
themes/default-bootstrap/modules/*/translations/*.php
themes/default-bootstrap/mails/*
!themes/default-bootstrap/mails/fr/
themes/default-bootstrap/modules/*/mails/*
!themes/default-bootstrap/modules/*/mails/fr
# MISC
*sitemap.xml
/robots.txt
# Symfony
/app/bootstrap.php.cache
/app/cache/*
!app/cache/.gitkeep
/app/Resources/translations/*
!/app/Resources/translations/default
/app/test/cache/*
!app/test/cache/.gitkeep
/app/config/parameters.yml
/app/config/parameters.php
/app/logs/*
!app/logs/.gitkeep
/app/phpunit.xml
/bin/
/web/bundles/
/web/css/
/web/js/
/var/
# Created by https://www.gitignore.io/api/linux,osx,windows,sublimetext,phpstorm
### Linux ###
*~
# KDE directory preferences
.directory
# Linux trash folder which might appear on any partition or disk
.Trash-*
### OSX ###
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
### Windows ###
# Windows image file caches
Thumbs.db
ehthumbs.db
# Folder config file
Desktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Windows Installer files
*.cab
*.msi
*.msm
*.msp
# Windows shortcuts
*.lnk
### SublimeText ###
# cache files for sublime text
*.tmlanguage.cache
*.tmPreferences.cache
*.stTheme.cache
# workspace files are user-specific
*.sublime-workspace
# project files should be checked into the repository, unless a significant
# proportion of contributors will probably not be using SublimeText
# *.sublime-project
# sftp configuration file
sftp-config.json
### PhpStorm ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio
*.iml
## Directory-based project format:
.idea/
## File-based project format:
*.ipr
*.iws
## Plugin-specific files:
# IntelliJ
/out/
# mpeltonen/sbt-idea plugin
.idea_modules/
# JIRA plugin
atlassian-ide-plugin.xml
# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
### NetBeans ###
nbproject/private/
build/
nbbuild/
dist/
nbdist/
nbactions.xml
nb-configuration.xml
.nb-gradle/
### Eclipse ###
.buildpath
.project
.settings/
.externalToolBuilders/
@tinyhazeleyes
Copy link

tinyhazeleyes commented Jul 8, 2018

Thank for posting this.

I added to mine:
config/defines.inc.php
modules/prestablock/cache

For prestablock you will have the IP files you have to add too.

Does anyone have a list of required files to get your Git repository to work on a new installation? Like how the app/config/parameters.php is required.

@Rairomero
Copy link

If I work with someone else, I want him to download my project, assuming Im using this gitignore, what have to do the other dev for run the project? Is there some steps by steps about what to do? Or what other solution can I use?

@AdrienAgnel
Copy link

AdrienAgnel commented Oct 11, 2019

Nice, thanks a lot ! What would you think about adding the var/ folder which is at the root of prestashop 1.7 projects ? it looks like it only includes cache and logs.

@prestarocket
Copy link
Author

Nice, thanks a lot ! What would you think about adding the var/ folder which is at the root of prestashop 1.7 projects ? it looks like it only includes cache and logs.

done

@bartoll
Copy link

bartoll commented Feb 10, 2021

Folder /vendor/* should be included but not .htaccess file

/vendor/*
!/vendor/.htaccess

@prestarocket
Copy link
Author

Folder /vendor/* should be included but not .htaccess file

/vendor/*
!/vendor/.htaccess

done, thx @bartoll

@arafatx
Copy link

arafatx commented Nov 26, 2021

Folder /vendor/* should be included but not .htaccess file

/vendor/*
!/vendor/.htaccess

done, thx @bartoll

It's a bit confusing when I read your statement at first. This should be wording like /vendor/* should be excluded but not .htaccess file. I don't understand why you include .htaccess in gitignore. For security reasons, you should not do this because .htaccess can contain httpasswd information. Maybe you can share why would you do this.

PS: this .gitignore file contains many unused or deprecated folders (probably taken from Prestashop 1.6). For example, in Prestashop 1.7 you should not have /app/cache folder or config/settings.inc.php.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment