I have this .gitignore file:
# Ignore wordpress
/wordpress/
/wordpress/*
# Except the wp-content folder
!/wordpress/wp-content/
!/wordpress/wp-content/*
But when I change something in wp-content the changes aren’t listed by git status, and if I do
git add wordpress/wp-content
I still get a warning .gitignore contains /wordpress/ and so doesn’t add the changes. Why is this?
Aditional
I’m on OSx, running git 1.7.3.2
I don’t believe that you want to ignore the
wordpressdirectory itself because there are some things in thewordpressdirectory that you do want to track. You only need to ignore most of the top-level paths in thewordpressdirectory.This
.gitignoreshould be sufficient.