.gitignore for Magento 1
29 ignore rules for Magento 1, ready to copy into your repository.
Magento version 1
The complete .gitignore for Magento 1
# Generated by LFGitignore - https://lfgitignore.com
# Created: 2026-08-05 01:34:17 UTC
# Technologies: Magento 1
### Magento 1 ###
/PATCH_*.sh
/app/etc/local.xml
/media/*
!/media/.htaccess
!/media/customer
/media/customer/*
!/media/customer/.htaccess
!/media/dhl
/media/dhl/*
!/media/dhl/logo.jpg
!/media/downloadable
/media/downloadable/*
!/media/downloadable/.htaccess
!/media/xmlconnect
/media/xmlconnect/*
!/media/xmlconnect/custom
/media/xmlconnect/custom/*
!/media/xmlconnect/custom/ok.gif
!/media/xmlconnect/original
/media/xmlconnect/original/*
!/media/xmlconnect/original/ok.gif
!/media/xmlconnect/system
/media/xmlconnect/system/*
!/media/xmlconnect/system/ok.gif
/var/*
!/var/.htaccess
!/var/package
/var/package/*
!/var/package/*.xml
What these Magento 1 rules actually ignore
Every pattern below, and why it belongs in your .gitignore.
It is recommended that you use `Magento.gitignore` as this is the latest version
| Pattern | What it ignores |
|---|---|
/PATCH_*.sh |
It is recommended that you use `Magento.gitignore` as this is the latest version |
/app/etc/local.xml |
It is recommended that you use `Magento.gitignore` as this is the latest version |
/media/* |
It is recommended that you use `Magento.gitignore` as this is the latest version |
!/media/.htaccess |
It is recommended that you use `Magento.gitignore` as this is the latest version |
!/media/customer |
It is recommended that you use `Magento.gitignore` as this is the latest version |
/media/customer/* |
It is recommended that you use `Magento.gitignore` as this is the latest version |
!/media/customer/.htaccess |
It is recommended that you use `Magento.gitignore` as this is the latest version |
!/media/dhl |
It is recommended that you use `Magento.gitignore` as this is the latest version |
/media/dhl/* |
It is recommended that you use `Magento.gitignore` as this is the latest version |
!/media/dhl/logo.jpg |
It is recommended that you use `Magento.gitignore` as this is the latest version |
!/media/downloadable |
It is recommended that you use `Magento.gitignore` as this is the latest version |
/media/downloadable/* |
It is recommended that you use `Magento.gitignore` as this is the latest version |
!/media/downloadable/.htaccess |
It is recommended that you use `Magento.gitignore` as this is the latest version |
!/media/xmlconnect |
It is recommended that you use `Magento.gitignore` as this is the latest version |
/media/xmlconnect/* |
It is recommended that you use `Magento.gitignore` as this is the latest version |
!/media/xmlconnect/custom |
It is recommended that you use `Magento.gitignore` as this is the latest version |
/media/xmlconnect/custom/* |
It is recommended that you use `Magento.gitignore` as this is the latest version |
!/media/xmlconnect/custom/ok.gif |
It is recommended that you use `Magento.gitignore` as this is the latest version |
!/media/xmlconnect/original |
It is recommended that you use `Magento.gitignore` as this is the latest version |
/media/xmlconnect/original/* |
It is recommended that you use `Magento.gitignore` as this is the latest version |
!/media/xmlconnect/original/ok.gif |
It is recommended that you use `Magento.gitignore` as this is the latest version |
!/media/xmlconnect/system |
It is recommended that you use `Magento.gitignore` as this is the latest version |
/media/xmlconnect/system/* |
It is recommended that you use `Magento.gitignore` as this is the latest version |
!/media/xmlconnect/system/ok.gif |
It is recommended that you use `Magento.gitignore` as this is the latest version |
/var/* |
It is recommended that you use `Magento.gitignore` as this is the latest version |
!/var/.htaccess |
It is recommended that you use `Magento.gitignore` as this is the latest version |
!/var/package |
It is recommended that you use `Magento.gitignore` as this is the latest version |
/var/package/* |
It is recommended that you use `Magento.gitignore` as this is the latest version |
!/var/package/*.xml |
It is recommended that you use `Magento.gitignore` as this is the latest version |
How to use this .gitignore for Magento 1
- Copy the Magento 1 rules above, or download the file directly.
- Create a file named .gitignore at the root of your Git repository and paste the rules into it.
- If some of those files are already tracked, run git rm -r --cached . then commit again — Git only applies ignore rules to untracked files.
- Commit the .gitignore so everyone on the team shares the same rules.