Our blog
Git Ignore All Files Except PHP etc + Solution
Using Git for version control is great, but if like my you work on a lot of different projects then everything you can do to save time setting Git up is well worth it.
One of the features of Git is the ability to only track certain files and ignore other files. For me that means I only want to track files I am likely to be editing and ignore images, flash files and whatever other junk is floating around in a project.
The solution (and all credit and thanks to the kind people on #Git on Freenode IRC) is this .gitignore file. This file will ignore everything except files with the extensions that you set. Dead easy.
-
#ignore everything apart from php, css, xml, htaccess, sql, js
-
*
-
!*/
-
!*.php
-
!*.css
-
!*.xml
-
!*.htaccess
-
!*.sql
-
!*.js
RSS Feed