]> source.dussan.org Git - gitignore.git/commitdiff
Fixes issue excluding sub directories 2315/head
authorHannes Elvemyr <git@elvemyrconsulting.se>
Thu, 9 Mar 2017 10:31:19 +0000 (11:31 +0100)
committerHannes Elvemyr <git@elvemyrconsulting.se>
Thu, 9 Mar 2017 10:31:19 +0000 (11:31 +0100)
This .gitignore is not correct. At least was not working for me.
Ignoring /media/* and then excluding !/media/customer/.htaccess is not
working. According to the Git manual, "It is not possible to re-include
a file if a parent directory of that file is excluded."
(https://git-scm.com/docs/gitignore).

Found a solution here:
http://stackoverflow.com/questions/987142/make-gitignore-ignore-everything-except-a-few-files/16318111#16318111

Magento.gitignore

index b282f5cf547036c5d98e21e940a1f5a12e082989..6f1fa22399234e187b5ee786ea3f0ee72ed1639b 100644 (file)
@@ -3,14 +3,41 @@
 #--------------------------#
 
 /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
+